Exemple #1
0
void Threading::Mutex::Detach()
{
	if( EBUSY != pthread_mutex_destroy(&m_mutex) ) return;

	if( IsRecursive() )
	{
		// Sanity check: Recursive locks could be held by our own thread, which would
		// be considered an assertion failure, but can also be handled gracefully.
		// (note: if the mutex is locked recursively more than twice then this assert won't
		//  detect it)

		Release(); Release();		// in case of double recursion.
		int result = pthread_mutex_destroy( &m_mutex );
		if( pxAssertDev( result != EBUSY, "Detachment of a recursively-locked mutex (self-locked!)." ) ) return;
	}

	if( Wait(def_detach_timeout) )
		pthread_mutex_destroy( &m_mutex );
	else
		Console.Error( "(Thread Log) Mutex cleanup failed due to possible deadlock.");
}
Exemple #2
0
void
cIpmiLog::End()
{
  if ( IsRecursive() )
       *this << "}\n\n\n";
}
Exemple #3
0
void
cIpmiLog::Begin( const char *section, const char *name )
{
  if ( IsRecursive() )
       *this << section << " \"" << name << "\"\n{\n";
}