SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Friends | List of all members
Mutex Class Reference

#include <Mutex.h>

Public Member Functions

 Mutex (const char *name)
 
 ~Mutex ()
 
void lock ()
 
bool tryLock ()
 
void unlock ()
 

Friends

class ConditionVariable
 

Constructor & Destructor Documentation

Mutex ( const char *  name)
explicit

Create the mutex. The mutex is allocated in the unlocked state. name should be a static string which describes the primitive for debugging purposes.

~Mutex ( )

Destroy the mutex. Destroying the mutex in the locked state has undefined results.

Member Function Documentation

void lock ( )

Acquire the Mutex. This method will block until the mutex is acquired.

bool tryLock ( )

Attempt to acquire the Mutex without blocking. Returns true if the mutex was available and actually acquired.

void unlock ( )

Release the Mutex, unblocking any other threads that are blocked waiting for the Mutex.

Friends And Related Function Documentation

friend class ConditionVariable
friend

The documentation for this class was generated from the following files: