diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-09-26 22:25:46 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-09-26 23:28:01 +0200 |
commit | ed4791eb2d516e2ce509c13ae63c95dd6bcb52c4 (patch) | |
tree | fc57e75f733403cf0d389232b0e6efc5c9585e2a /svx | |
parent | 423142538e81d28229c769e0617c6a00a648709a (diff) |
svx: convert some horrible code to SolarMutexTryAndBuyGuard
Try to preserve the existing spin-lock insanity as-is.
Change-Id: Ic98aa33d2e56536856892fcf61de672952101ae1
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/fmcomp/gridctrl.cxx | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 0673bfe998d3..d9e92c3be61f 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -3545,23 +3545,16 @@ void DbGridControl::FieldValueChanged(sal_uInt16 _nId, const PropertyChangeEvent DbGridColumn* pColumn = ( Location < m_aColumns.size() ) ? m_aColumns[ Location ] : NULL; if (pColumn) { - bool bAcquiredPaintSafety = false; - while (!m_bWantDestruction && !bAcquiredPaintSafety) - bAcquiredPaintSafety = Application::GetSolarMutex().tryToAcquire(); + boost::scoped_ptr<vcl::SolarMutexTryAndBuyGuard> pGuard; + while (!m_bWantDestruction && (!pGuard || !pGuard->isAcquired())) + pGuard.reset(new vcl::SolarMutexTryAndBuyGuard); if (m_bWantDestruction) { // at this moment, within another thread, our destructor tries to destroy the listener which called this method // => don't do anything // 73365 - 23.02.00 - FS - if (bAcquiredPaintSafety) - // though the above while-loop suggests that (m_bWantDestruction && bAcquiredPaintSafety) is impossible, - // it isnt't, as m_bWantDestruction isn't protected with any mutex - Application::GetSolarMutex().release(); return; } - // here we got the solar mutex, transfer it to a guard for safety reasons - SolarMutexGuard aPaintSafety; - Application::GetSolarMutex().release(); // and finally do the update ... pColumn->UpdateFromField(m_xCurrentRow, m_xFormatter); |