|
libcmutils 0.6.5
Multi-platform C99 utility library
|
Platform independent mutex implementation. More...
Data Fields | |
| void(* | Lock )(CMUTIL_Mutex *mutex) |
| Lock this mutex object. | |
| void(* | Unlock )(CMUTIL_Mutex *mutex) |
| Unlock this mutex object. | |
| CMBool(* | TryLock )(CMUTIL_Mutex *mutex) |
| Try to lock the given mutex object. | |
| void(* | Destroy )(CMUTIL_Mutex *mutex) |
| Destroys all resources related to this object. | |
Platform independent mutex implementation.
| void(* CMUTIL_Mutex::Lock) (CMUTIL_Mutex *mutex) |
Lock this mutex object.
This mutex object shall be locked. If this mutex is already locked by another thread, the calling thread shall block until this mutex becomes available. This method shall return with this mutex object in the locked state with the calling thread as its owner.
This mutex is a recursive lockable object. This mutex shall maintain the concept of lock count. When a thread successfully acquires a mutex for the first time, the lock count shall be set to one. Every time a thread relocks this mutex, the lock count shall be incremented by one. Each time the thread unlocks the mutex, the lock count shall be decremented by one. When the lock count reaches zero, the mutex shall become available for other threads to acquire.
| mutex | This mutex object. |
| void(* CMUTIL_Mutex::Unlock) (CMUTIL_Mutex *mutex) |
Unlock this mutex object.
This mutex object shall be unlocked if the lock count reaches zero.
| mutex | This mutex object. |
| CMBool(* CMUTIL_Mutex::TryLock) (CMUTIL_Mutex *mutex) |
Try to lock the given mutex object.
| mutex | a mutex object to be tested. |
| void(* CMUTIL_Mutex::Destroy) (CMUTIL_Mutex *mutex) |
Destroys all resources related to this object.
| mutex | This mutex object. |