This class provides a full specialization of MutexImpl for pthreads. It provides a efficient proxy for the pthread_mutex_t pthreads type, and related operations. Note that the mutex implemented in this class is not error checking, and is non‐recursive.
Synopsis
Declared in <bslmt_muteximpl_pthread.h>
template<>
class MutexImpl<Platform::PosixThreads>;
Type Aliases
Name |
Description |
The underlying OS‐level type. Exposed so that other |
Member Functions
Name |
Description |
|
Create a mutex initialized to an unlocked state. This method does not return normally unless there are sufficient system resources to construct the object. |
|
Destroy this mutex object. The behavior is undefined if the mutex is in a locked state. |
Acquire a lock on this mutex object. If this object is currently locked, then suspend execution of the current thread until a lock can be acquired. Note that the behavior is undefined if the calling thread already owns the lock on this mutex, and will likely result in a deadlock. |
|
Return a reference to the modifiable OS‐level mutex underlying this object. This method is intended only to support other |
|
Attempt to acquire a lock on this mutex object. Return 0 on success, and a non‐zero value of this object is already locked, or if an error occurs. |
|
Release a lock on this mutex that was previously acquired through a successful call to |
Created with MrDocs