![]() |
Discrete Dipole Approximation Project
1.0
Plugin based Discrete Dipole Approximation (DDA) software package.
|
Mutex object, provides basic thread synchronization a Mutex and by held by a single thread at a time the mutex is aquired by calling Lock or TryLock and released by calling Unlock.
#include "thread.h"
Public Member Functions | |
Mutex (bool Lock=false) | |
Constructs a new Mutex Object, it Lock is true the new Mutex Object is held by the current thread. | |
~Mutex () | |
Destroys the Mutex Object. | |
bool | Lock (unsigned long timeout, bool execpt=true) |
Aquires the Mutex object when the Mutex is unlocked. More... | |
bool | TryLock () |
Atempts to aquire the Mutex and returns immediately. More... | |
bool | Unlock () |
Release the Mutex. More... | |
|
inline |
If the Mutex is locked, this call will block until the Mutex is unlocked of timeout
has been exceeded.
true
if aquired, false
otherwise. TimeoutException | Raised in execpt is true and timeout has been exceeded. |
|
inline |
This function will fail if the Mutex is locked.
true
if aquired, false
otherwise.
|
inline |
true
on success, false
on error.