HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
spin_rw_mutex Class Reference

#include <thread.h>

Classes

class  read_lock_guard
 
class  write_lock_guard
 

Public Member Functions

 spin_rw_mutex () noexcept
 
 ~spin_rw_mutex () noexcept
 
 spin_rw_mutex (const spin_rw_mutex &)=delete
 
const spin_rw_mutexoperator= (const spin_rw_mutex &)=delete
 
void read_lock () noexcept
 
void read_unlock () noexcept
 
void write_lock () noexcept
 
void write_unlock () noexcept
 
void lock ()
 lock() is a synonym for exclusive (write) lock. More...
 
void unlock ()
 unlock() is a synonym for exclusive (write) unlock. More...
 

Detailed Description

Spinning reader/writer mutex. This is just like spin_mutex, except that there are separate locking mechanisms for "writers" (exclusive holders of the lock, presumably because they are modifying whatever the lock is protecting) and "readers" (non-exclusive, non-modifying tasks that may access the protectee simultaneously).

Definition at line 391 of file thread.h.

Constructor & Destructor Documentation

spin_rw_mutex::spin_rw_mutex ( )
inlinenoexcept

Default constructor – initialize to unlocked.

Definition at line 395 of file thread.h.

spin_rw_mutex::~spin_rw_mutex ( )
inlinenoexcept

Definition at line 397 of file thread.h.

spin_rw_mutex::spin_rw_mutex ( const spin_rw_mutex )
delete

Member Function Documentation

void spin_rw_mutex::lock ( )
inline

lock() is a synonym for exclusive (write) lock.

Definition at line 466 of file thread.h.

const spin_rw_mutex& spin_rw_mutex::operator= ( const spin_rw_mutex )
delete
void spin_rw_mutex::read_lock ( )
inlinenoexcept

Acquire the reader lock.

Definition at line 405 of file thread.h.

void spin_rw_mutex::read_unlock ( )
inlinenoexcept

Release the reader lock.

Definition at line 432 of file thread.h.

void spin_rw_mutex::unlock ( )
inline

unlock() is a synonym for exclusive (write) unlock.

Definition at line 469 of file thread.h.

void spin_rw_mutex::write_lock ( )
inlinenoexcept

Acquire the writer lock.

Definition at line 442 of file thread.h.

void spin_rw_mutex::write_unlock ( )
inlinenoexcept

Release the writer lock.

Definition at line 459 of file thread.h.


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