Dev Essential  1.6.3
Loading...
Searching...
No Matches
a_util::concurrency::fast_mutex Class Reference

Fast mutex class, implemented as an atomic spin lock with very low CPU overhead. More...

#include <fast_mutex.h>

Public Types

typedef void * native_handle_type
 Type of a native handle.
 

Public Member Functions

 fast_mutex ()
 CTOR.
 
 ~fast_mutex ()
 DTOR.
 
void lock ()
 Lock the mutex.
 
bool try_lock ()
 
void unlock ()
 Unlock the mutex.
 
native_handle_type native_handle ()
 

Detailed Description

Fast mutex class, implemented as an atomic spin lock with very low CPU overhead.

Member Function Documentation

◆ native_handle()

native_handle_type a_util::concurrency::fast_mutex::native_handle ( )

Get the native handle of the mutex

Returns
Pointer to the native handle of the mutex. On Windows this is a pointer to struct CRITICAL_SECTION. On POSIX this is a pointer to struct pthread_mutex_t.

◆ try_lock()

bool a_util::concurrency::fast_mutex::try_lock ( )

Try to lock the mutex

Returns
true if locking succeeded, false otherwise.

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