ORIGINAL
Loading...
Searching...
No Matches
original::pMutex Class Referencefinal

POSIX thread mutex implementation. More...

#include <mutex.h>

Inheritance diagram for original::pMutex:
Inheritance graph
Collaboration diagram for original::pMutex:
Collaboration graph

Public Types

using native_handle = pthread_mutex_t
 Native handle type (pthread_mutex_t)
 

Public Member Functions

 pMutex ()
 Constructs and initializes the mutex.
 
 pMutex (pMutex &&)=delete
 Deleted move constructor.
 
pMutexoperator= (pMutex &&)=delete
 Deleted move assignment operator.
 
ul_integer id () const override
 Gets a unique identifier for the mutex.
 
void * nativeHandle () noexcept override
 Gets the native mutex handle.
 
void lock () override
 Locks the mutex, blocking if necessary.
 
bool tryLock () override
 Attempts to lock the mutex without blocking.
 
void unlock () override
 Unlocks the mutex.
 
 ~pMutex () override
 Destroys the mutex.
 
- Public Member Functions inherited from original::mutexBase
 mutexBase ()=default
 Default constructor.
 
 mutexBase (const mutexBase &)=delete
 Deleted copy constructor.
 
mutexBaseoperator= (const mutexBase &)=delete
 Deleted copy assignment operator.
 
virtual ~mutexBase ()=default
 Virtual destructor.
 

Additional Inherited Members

- Protected Member Functions inherited from original::mutexBase

Detailed Description

POSIX thread mutex implementation.

Wrapper around pthread_mutex_t with RAII semantics. Provides basic mutex functionality with proper initialization and cleanup.

Constructor & Destructor Documentation

◆ pMutex()

original::pMutex::pMutex ( )
inlineexplicit

Constructs and initializes the mutex.

Exceptions
sysErrorif mutex initialization fails

◆ ~pMutex()

original::pMutex::~pMutex ( )
inlineoverride

Destroys the mutex.

Note
Calls std::terminate() if mutex destruction fails

Member Function Documentation

◆ id()

original::ul_integer original::pMutex::id ( ) const
inlinenodiscardoverridevirtual

Gets a unique identifier for the mutex.

Returns
Unique identifier based on mutex internal state

Implements original::mutexBase.

◆ lock()

void original::pMutex::lock ( )
inlineoverridevirtual

Locks the mutex, blocking if necessary.

Exceptions
sysErrorif the lock operation fails

Implements original::mutexBase.

◆ nativeHandle()

void * original::pMutex::nativeHandle ( )
inlinenodiscardoverridevirtualnoexcept

Gets the native mutex handle.

Returns
Pointer to the internal pthread_mutex_t

Implements original::mutexBase.

◆ tryLock()

bool original::pMutex::tryLock ( )
inlineoverridevirtual

Attempts to lock the mutex without blocking.

Returns
true if lock was acquired, false if mutex is busy
Exceptions
sysErrorif the operation fails (other than EBUSY)

Implements original::mutexBase.

◆ unlock()

void original::pMutex::unlock ( )
inlineoverridevirtual

Unlocks the mutex.

Exceptions
sysErrorif the unlock operation fails

Implements original::mutexBase.


The documentation for this class was generated from the following file: