Full specialization of MutexImpl for pthreads.

Synopsis

Declared in <bslmt_muteximpl_pthread.h>

template<>
class MutexImpl<Platform::PosixThreads>;

Description

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.

Type Aliases

Name

Description

NativeType

The underlying OS‐level type. Exposed so that other bslmt components can operate directly on this mutex.

Member Functions

Name

Description

MutexImpl [constructor]

Create a mutex initialized to an unlocked state. This method does not return normally unless there are sufficient system resources to construct the object.

~MutexImpl [destructor]

Destroy this mutex object. The behavior is undefined if the mutex is in a locked state.

lock

Acquire a lock on this mutex object.

nativeMutex

Return a reference to the modifiable OS‐level mutex underlying this object.

tryLock

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.

unlock

Release a lock on this mutex.

Created with MrDocs