summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-04-12 14:47:45 +0200
committerMichael Stahl <mstahl@redhat.com>2016-04-12 15:17:04 +0200
commit1a3fd60b983c9b98c75c746359abf434d013683c (patch)
treebf4cb7929306072e9366f502ac9fe2b5d5cdd8d0 /vcl/win
parentedac93859ba8b6446dce08b0cffb9def3d9ff182 (diff)
vcl: simplify WNT SalYieldMutex::release() further ...
... by asserting that the current thread is the owner of the SalYieldMutex. Anything else would be a bug anyway. Change-Id: I564c184ae21b99a096f67edbc729b3f2b0e307de
Diffstat (limited to 'vcl/win')
-rw-r--r--vcl/win/app/salinst.cxx39
1 files changed, 18 insertions, 21 deletions
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index d55fa70921e0..346d439f8ba9 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -143,33 +143,30 @@ void SalYieldMutex::acquire()
void SalYieldMutex::release()
{
DWORD nThreadId = GetCurrentThreadId();
- if ( mnThreadId != nThreadId )
- m_mutex.release();
- else
+ assert(mnThreadId == nThreadId);
+
+ bool const isRelease(1 == mnCount);
+ if ( isRelease )
{
- bool const isRelease(1 == mnCount);
- if ( isRelease )
- {
- OpenGLContext::prepareForYield();
+ OpenGLContext::prepareForYield();
- SalData* pSalData = GetSalData();
- if ( pSalData->mnAppThreadId != nThreadId )
- {
- // If we don't call these message, the Output from the
- // Java clients doesn't come in the right order
- GdiFlush();
+ SalData* pSalData = GetSalData();
+ if ( pSalData->mnAppThreadId != nThreadId )
+ {
+ // If we don't call these message, the Output from the
+ // Java clients doesn't come in the right order
+ GdiFlush();
- }
- mnThreadId = 0;
}
+ mnThreadId = 0;
+ }
- mnCount--;
- m_mutex.release();
+ mnCount--;
+ m_mutex.release();
- if ( isRelease )
- { // do this *after* release
- m_condition.set(); // wake up ImplSalYieldMutexAcquireWithWait()
- }
+ if ( isRelease )
+ { // do this *after* release
+ m_condition.set(); // wake up ImplSalYieldMutexAcquireWithWait()
}
}