Exemple #1
0
/** \brief Destroy the mutex
 */
void
os_mutexDestroy (os_mutex *mutex)
{
   Error err = Success;

   assert(mutex != NULL);

   if ( mutex->localsem != 0 )
   {
      err = CloseSemaphore(mutex->localsem);
   }
   else
   {
      assert( mutex->uid != 0 );
      err = rsRemoveSemaphore(mutex->index);
      if ( err == Success )
      {
         err = os_mutexMapFindAndRemove(mutex);
      }
   }

#ifndef NDEBUG
   if ( err == Success )
   {
      mutex->signature = 0;
   }
#endif

   if (err != Success) {
       abort ();
   }
}
Exemple #2
0
void CThreadBase::DoRunThreadL()
	{
	CActiveScheduler*  scheduler = NULL;
	scheduler = new (ELeave) CActiveScheduler;
	CleanupStack::PushL(scheduler);
	CActiveScheduler::Install(scheduler);

	OpenSemaphore();
	SetUpTestL( ThreadName() );
	
	ThreadL();
	
	TakeDownTest();
	CloseSemaphore();
	
	CleanupStack::PopAndDestroy(scheduler);
	}
CConcurrentDatabaseAccessBase::~CConcurrentDatabaseAccessBase()
	{
	iThread.Close();
	CloseSemaphore();
	delete iDatabaseName;
	}
Exemple #4
0
CThreadBase::~CThreadBase()
	{
	iThread.Close();
	CloseSemaphore();
	}