#include <thread.h>
Inheritance diagram for more::cf::mutex:
Mutex locks are used to prevent different threads from accessing the same collection of interdependent data simultaneously. If the conditions given for the member functions are violated, a logic_error will be thrown. Also, runtime_error may be throw in case of lack of resources.
|
The non-trivial default ctor initializes a new mutex.
|
|
Copy ctor with shallow-copy semantic.
|
|
Destructor. The destructor requires that the mutex is currently unlocked. |
|
Lock the mutex. The mutex must not be already locked in the same thread. If it is locked by another thread, this call will suspend the current thread until it is unlocked. |
|
Assignment with shallow-copy semantic.
|
|
Lock the mutex if it is unlocked. Same as lock(), except that when the mutex is locked by another thread, this call exits with false. Otherwise it exits with true. |
|
Unlock a mutex.
|
|
|