#include <UMutex.h>
A mutex class.
On a lock() call, the calling thread is blocked if the UMutex was previously locked by another thread. It is unblocked when unlock() is called.
On Unix (not yet tested on Windows), UMutex is recursive: the same thread can call multiple times lock() without being blocked.
Example:
- See also
- USemaphore
Definition at line 54 of file UMutex.h.
◆ UMutex()
The constructor.
Definition at line 62 of file UMutex.h.
◆ ~UMutex()
| virtual UMutex::~UMutex |
( |
| ) |
|
|
inlinevirtual |
◆ lock()
| int UMutex::lock |
( |
| ) |
const |
|
inline |
Lock the mutex.
- Returns
- 0 on success, an error code otherwise.
Definition at line 88 of file UMutex.h.
◆ lockTry()
| int UMutex::lockTry |
( |
| ) |
const |
|
inline |
Try locking the mutex.
- Returns
- 0 if the mutex has been locked by this call, EBUSY (or another error code) otherwise.
Definition at line 110 of file UMutex.h.
◆ unlock()
| int UMutex::unlock |
( |
| ) |
const |
|
inline |
Unlock the mutex.
- Returns
- 0 on success, an error code otherwise.
Definition at line 120 of file UMutex.h.
The documentation for this class was generated from the following file:
- utilite/include/rtabmap/utilite/UMutex.h