#include <pmutex.h>
Public Member Functions | |
Mutex () | |
~Mutex () | |
void | lock () const |
Grabs the mutex if it is available. | |
void | release () const |
Releases the mutex. | |
Private Member Functions | |
Mutex (const Mutex ©) | |
Do not attempt to copy mutexes. | |
void | operator= (const Mutex ©) |
Do not attempt to copy mutexes. | |
Private Attributes | |
MutexImpl | _impl |
Friends | |
class | ConditionVar |
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.
Definition at line 42 of file pmutex.h.
|
Definition at line 31 of file pmutex.I. References INLINE. |
|
|
|
Do not attempt to copy mutexes.
Definition at line 54 of file pmutex.I. References nassertv. |
|
Grabs the mutex if it is available. If it is not available, blocks until it becomes available, then grabs it. In either case, the function does not return until the mutex is held; you should then call unlock(). This method is considered const so that you can lock and unlock const mutexes, mainly to allow thread-safe access to otherwise const data. Also see MutexHolder. Definition at line 100 of file pmutex.I. Referenced by GraphicsEngine::cull_and_draw_together(). |
|
Do not attempt to copy mutexes.
|
|
Releases the mutex. It is an error to call this if the mutex was not already locked. This method is considered const so that you can lock and unlock const mutexes, mainly to allow thread-safe access to otherwise const data. Definition at line 123 of file pmutex.I. Referenced by GraphicsEngine::cull_and_draw_together(). |
|
|
|
Definition at line 55 of file pmutex.h. Referenced by operator=(). |