Kaydet (Commit) 1a3fd60b authored tarafından Michael Stahl's avatar Michael Stahl

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
üst edac9385
...@@ -143,33 +143,30 @@ void SalYieldMutex::acquire() ...@@ -143,33 +143,30 @@ void SalYieldMutex::acquire()
void SalYieldMutex::release() void SalYieldMutex::release()
{ {
DWORD nThreadId = GetCurrentThreadId(); DWORD nThreadId = GetCurrentThreadId();
if ( mnThreadId != nThreadId ) assert(mnThreadId == nThreadId);
m_mutex.release();
else bool const isRelease(1 == mnCount);
if ( isRelease )
{ {
bool const isRelease(1 == mnCount); OpenGLContext::prepareForYield();
if ( isRelease )
{
OpenGLContext::prepareForYield();
SalData* pSalData = GetSalData(); SalData* pSalData = GetSalData();
if ( pSalData->mnAppThreadId != nThreadId ) if ( pSalData->mnAppThreadId != nThreadId )
{ {
// If we don't call these message, the Output from the // If we don't call these message, the Output from the
// Java clients doesn't come in the right order // Java clients doesn't come in the right order
GdiFlush(); GdiFlush();
}
mnThreadId = 0;
} }
mnThreadId = 0;
}
mnCount--; mnCount--;
m_mutex.release(); m_mutex.release();
if ( isRelease ) if ( isRelease )
{ // do this *after* release { // do this *after* release
m_condition.set(); // wake up ImplSalYieldMutexAcquireWithWait() m_condition.set(); // wake up ImplSalYieldMutexAcquireWithWait()
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment