ORIGINAL
Loading...
Searching...
No Matches
original::mutexBase Class Referenceabstract

Abstract base class for mutex implementations. More...

#include <mutex.h>

Inheritance diagram for original::mutexBase:
Inheritance graph
Collaboration diagram for original::mutexBase:
Collaboration graph

Public Member Functions

 mutexBase ()=default
 Default constructor.
 
 mutexBase (const mutexBase &)=delete
 Deleted copy constructor.
 
mutexBaseoperator= (const mutexBase &)=delete
 Deleted copy assignment operator.
 
virtual void * nativeHandle () noexcept=0
 Gets the native handle of the mutex.
 
virtual ~mutexBase ()=default
 Virtual destructor.
 

Protected Member Functions

virtual void lock ()=0
 Locks the mutex, blocking if necessary.
 
virtual bool tryLock ()=0
 Attempts to lock the mutex without blocking.
 
virtual void unlock ()=0
 Unlocks the mutex.
 
virtual ul_integer id () const =0
 Gets a unique identifier for the mutex.
 

Detailed Description

Abstract base class for mutex implementations.

Provides the interface for mutex operations including:

  • Lock/unlock functionality
  • Try-lock capability
  • Access to native handle
Note
This is an abstract base class and cannot be instantiated directly. Derived classes must implement all pure virtual methods.

Member Function Documentation

◆ id()

virtual ul_integer original::mutexBase::id ( ) const
nodiscardprotectedpure virtual

Gets a unique identifier for the mutex.

Returns
Unique identifier based on mutex internal state

Implemented in original::pMutex.

◆ lock()

virtual void original::mutexBase::lock ( )
protectedpure virtual

Locks the mutex, blocking if necessary.

Exceptions
sysErrorif the lock operation fails

Implemented in original::pMutex.

◆ nativeHandle()

virtual void * original::mutexBase::nativeHandle ( )
nodiscardpure virtualnoexcept

Gets the native handle of the mutex.

Returns
Pointer to the native mutex handle

Implemented in original::pMutex.

◆ tryLock()

virtual bool original::mutexBase::tryLock ( )
protectedpure virtual

Attempts to lock the mutex without blocking.

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

Implemented in original::pMutex.

◆ unlock()

virtual void original::mutexBase::unlock ( )
protectedpure virtual

Unlocks the mutex.

Exceptions
sysErrorif the unlock operation fails

Implemented in original::pMutex.


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