Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
ordered_mutex Class Reference

#include <ordered_mutex.h>

+ Collaboration diagram for ordered_mutex:

Public Member Functions

 ordered_mutex ()
 
void lock ()
 
bool try_lock ()
 
void unlock ()
 

Private Attributes

std::condition_variable cv
 
std::mutex cv_lock
 
uint_fast32_t next_ticket
 
uint_fast32_t counter
 

Constructor & Destructor Documentation

◆ ordered_mutex()

ordered_mutex::ordered_mutex ( )
inline

Member Function Documentation

◆ lock()

void ordered_mutex::lock ( )
inline

References counter, cv, cv_lock, and next_ticket.

◆ try_lock()

bool ordered_mutex::try_lock ( )
inline

References counter, cv_lock, and next_ticket.

◆ unlock()

void ordered_mutex::unlock ( )
inline

References counter, cv, and cv_lock.

Member Data Documentation

◆ counter

uint_fast32_t ordered_mutex::counter
private

Referenced by lock(), try_lock(), and unlock().

◆ cv

std::condition_variable ordered_mutex::cv
private

Referenced by lock(), and unlock().

◆ cv_lock

std::mutex ordered_mutex::cv_lock
private

Referenced by lock(), try_lock(), and unlock().

◆ next_ticket

uint_fast32_t ordered_mutex::next_ticket
private

Referenced by lock(), and try_lock().


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