ManaPlus
Public Member Functions | Private Member Functions
fast_mutex Class Reference

#include <fast_mutex.h>

Public Member Functions

 fast_mutex ()
 
 ~fast_mutex ()
 
void lock ()
 
void unlock ()
 

Private Member Functions

 fast_mutex (const fast_mutex &)
 
fast_mutexoperator= (const fast_mutex &)
 

Detailed Description

Class for non-reentrant fast mutexes. This is the null implementation for single-threaded environments.

Definition at line 370 of file fast_mutex.h.

Constructor & Destructor Documentation

◆ fast_mutex() [1/2]

fast_mutex::fast_mutex ( )
inline

Definition at line 376 of file fast_mutex.h.

378  : _M_locked(false)
379 # endif
380  {
381  }

◆ ~fast_mutex()

fast_mutex::~fast_mutex ( )
inline

Definition at line 382 of file fast_mutex.h.

383  {
384  _FAST_MUTEX_ASSERT(!_M_locked, "~fast_mutex(): still locked");
385  }
#define _FAST_MUTEX_ASSERT(_Expr, _Msg)
Definition: fast_mutex.h:142

References _FAST_MUTEX_ASSERT.

◆ fast_mutex() [2/2]

fast_mutex::fast_mutex ( const fast_mutex )
private

Member Function Documentation

◆ lock()

void fast_mutex::lock ( )
inline

Definition at line 386 of file fast_mutex.h.

387  {
388 # ifdef _DEBUG
389  _FAST_MUTEX_ASSERT(!_M_locked, "lock(): already locked");
390  _M_locked = true;
391 # endif
392  }

References _FAST_MUTEX_ASSERT.

Referenced by fast_mutex_autolock::fast_mutex_autolock().

◆ operator=()

fast_mutex& fast_mutex::operator= ( const fast_mutex )
private

◆ unlock()

void fast_mutex::unlock ( )
inline

Definition at line 393 of file fast_mutex.h.

394  {
395 # ifdef _DEBUG
396  _FAST_MUTEX_ASSERT(_M_locked, "unlock(): not locked");
397  _M_locked = false;
398 # endif
399  }

References _FAST_MUTEX_ASSERT.

Referenced by fast_mutex_autolock::~fast_mutex_autolock().


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