#include <Threads.h>
Inheritance diagram for H3D::MutexLock:

Public Member Functions | |
| MutexLock () | |
| Constructor. | |
| ~MutexLock () | |
| Destructor. | |
| void | lock () |
| Locks the mutex. | |
| void | unlock () |
| Unlocks the mutex. | |
| bool | tryLock () |
| Try to lock the mutex, if the lock is not available false is returned. | |
Protected Attributes | |
| pthread_mutex_t | mutex |
Most common usage is to make sure that only one thread enters a "critical section" at a time. E.g. if both threads uses the same variable we must put a lock around the access to make sure that two threads does not access it at once.
|
|
Locks the mutex. If already locked, waits until it is unlocked and then locks it. |
1.4.5