diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2010-10-08 11:48:35 +0200 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2010-10-08 11:48:35 +0200 |
commit | 6b2736fed5bb3c5e7949be2baa4a50c9a9c9b3e2 (patch) | |
tree | 3bec48818d0989ef7e9936723c80a176519d00e6 /vcl/os2 | |
parent | 525de6f8eeac6e357167467da0f9a9448433bb25 (diff) |
vcl116: #i114958# implement DBG_TESTSOALRMUTEX on all platforms
Diffstat (limited to 'vcl/os2')
-rw-r--r-- | vcl/os2/inc/salinst.h | 1 | ||||
-rw-r--r-- | vcl/os2/source/app/salinst.cxx | 12 |
2 files changed, 6 insertions, 7 deletions
diff --git a/vcl/os2/inc/salinst.h b/vcl/os2/inc/salinst.h index 0948f605c286..536712d37836 100644 --- a/vcl/os2/inc/salinst.h +++ b/vcl/os2/inc/salinst.h @@ -85,6 +85,7 @@ public: virtual vos::IMutex* GetYieldMutex(); virtual ULONG ReleaseYieldMutex(); virtual void AcquireYieldMutex( ULONG nCount ); + virtual bool CheckYieldMutex(); virtual void Yield( bool, bool ); virtual bool AnyInput( USHORT nType ); virtual SalMenu* CreateMenu( BOOL bMenuBar ); diff --git a/vcl/os2/source/app/salinst.cxx b/vcl/os2/source/app/salinst.cxx index b08a9769ccf4..df564f36ee0a 100644 --- a/vcl/os2/source/app/salinst.cxx +++ b/vcl/os2/source/app/salinst.cxx @@ -298,10 +298,9 @@ void ImplSalAcquireYieldMutex( ULONG nCount ) // ----------------------------------------------------------------------- -#ifdef DBG_UTIL - -void ImplDbgTestSolarMutex() +bool Os2SalInstance::CheckYieldMutex() { + bool bRet = true; SalData* pSalData = GetSalData(); ULONG nCurThreadId = GetCurrentThreadId(); if ( pSalData->mnAppThreadId != nCurThreadId ) @@ -311,7 +310,7 @@ void ImplDbgTestSolarMutex() SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex; if ( pYieldMutex->mnThreadId != nCurThreadId ) { - DBG_ERROR( "SolarMutex not locked, and not thread save code in VCL is called from outside of the main thread" ); + bRet = false; } } } @@ -322,14 +321,13 @@ void ImplDbgTestSolarMutex() SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex; if ( pYieldMutex->mnThreadId != nCurThreadId ) { - DBG_ERROR( "SolarMutex not locked in the main thread" ); + bRet = false; } } } + return bRet; } -#endif - // ======================================================================= void InitSalData() |