From: <ric...@us...> - 2009-09-26 23:07:17
|
Revision: 1024 http://loki-lib.svn.sourceforge.net/loki-lib/?rev=1024&view=rev Author: rich_sposato Date: 2009-09-26 23:07:10 +0000 (Sat, 26 Sep 2009) Log Message: ----------- Replaced assert( IsValid() ) with checker's call to IsValid. Modified Paths: -------------- trunk/include/loki/LevelMutex.h Modified: trunk/include/loki/LevelMutex.h =================================================================== --- trunk/include/loki/LevelMutex.h 2009-09-26 21:10:43 UTC (rev 1023) +++ trunk/include/loki/LevelMutex.h 2009-09-26 23:07:10 UTC (rev 1024) @@ -280,8 +280,9 @@ { public: inline explicit Checker( const volatile LevelMutexInfo * mutex ) : - m_mutex( mutex ) {} - inline ~Checker( void ) { m_mutex->IsValid(); } + m_mutex( mutex ) { Check(); } + inline ~Checker( void ) { Check(); } + inline bool Check( void ) const { return m_mutex->IsValid(); } private: Checker( void ); Checker( const Checker & ); @@ -782,7 +783,6 @@ virtual MutexErrors::Type TryLock( void ) volatile { - assert( IsValid() ); LOKI_MUTEX_DEBUG_CODE( Checker checker( this ); (void)checker; ) MutexErrors::Type result = LevelMutexInfo::PreLockCheck( true ); @@ -804,7 +804,6 @@ virtual MutexErrors::Type Lock( void ) volatile { - assert( IsValid() ); LOKI_MUTEX_DEBUG_CODE( Checker checker( this ); (void)checker; ) MutexErrors::Type result = LevelMutexInfo::PreLockCheck( false ); @@ -824,7 +823,6 @@ virtual MutexErrors::Type Lock( unsigned int milliSeconds ) volatile { - assert( IsValid() ); LOKI_MUTEX_DEBUG_CODE( Checker checker( this ); (void)checker; ) MutexErrors::Type result = LevelMutexInfo::PreLockCheck( false ); @@ -860,7 +858,6 @@ virtual MutexErrors::Type Unlock( void ) volatile { - assert( IsValid() ); LOKI_MUTEX_DEBUG_CODE( Checker checker( this ); (void)checker; ) MutexErrors::Type result = LevelMutexInfo::PreUnlockCheck(); @@ -906,7 +903,6 @@ */ virtual MutexErrors::Type LockThis( void ) volatile { - assert( IsValid() ); LOKI_MUTEX_DEBUG_CODE( Checker checker( this ); (void)checker; ) assert( this != LevelMutexInfo::GetCurrentMutex() ); @@ -927,7 +923,6 @@ */ virtual MutexErrors::Type LockThis( unsigned int milliSeconds ) volatile { - assert( IsValid() ); LOKI_MUTEX_DEBUG_CODE( Checker checker( this ); (void)checker; ) clock_t timeOut = clock() + milliSeconds; @@ -953,9 +948,8 @@ */ virtual MutexErrors::Type UnlockThis( void ) volatile { - assert( IsValid() ); - assert( NULL != LevelMutexInfo::GetCurrentMutex() ); LOKI_MUTEX_DEBUG_CODE( Checker checker( this ); (void)checker; ) + assert( NULL != LevelMutexInfo::GetCurrentMutex() ); if ( 1 < LevelMutexInfo::GetLockCount() ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |