Panda3D
|
A standard mutex, or mutual exclusion lock. More...
#include "pmutex.h"
Public Member Functions | |
Mutex (const char *name) | |
Mutex (const string &name) | |
Static Public Attributes | |
static Mutex | _notify_mutex |
A standard mutex, or mutual exclusion lock.
Only one thread can hold ("lock") a mutex at any given time; other threads trying to grab the mutex will block until the holding thread releases it.
The standard mutex is not reentrant: a thread may not attempt to lock it twice. Although this may happen to work on some platforms (e.g. Win32), it will not work on all platforms; on some platforms, a thread can deadlock itself by attempting to lock the same mutex twice. If your code requires a reentrant mutex, use the ReMutex class instead.
This class inherits its implementation either from MutexDebug or MutexDirect, depending on the definition of DEBUG_THREADS.