mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Friends
m::read_lock Struct Reference

#include <reader_writer_lock.hpp>

Inheritance diagram for m::read_lock:
[legend]
Collaboration diagram for m::read_lock:
[legend]

Public Member Functions

 read_lock (reader_writer_mutex &rw_mutex)
 
 read_lock (reader_writer_mutex &rw_mutex, std::defer_lock_t)
 
 read_lock (reader_writer_mutex &rw_mutex, std::adopt_lock_t)
 
 read_lock (const read_lock &)=delete
 
 read_lock (read_lock &&other)
 
 ~read_lock ()
 
read_lockoperator= (read_lock &&other)
 
bool owns_lock () const
 
void lock ()
 
void unlock ()
 

Protected Attributes

std::reference_wrapper< reader_writer_mutexrw_mutex_
 
bool owns_lock_ {false}
 

Friends

void swap (read_lock &first, read_lock &second)
 

Detailed Description

Definition at line 312 of file reader_writer_lock.hpp.

Constructor & Destructor Documentation

◆ read_lock() [1/5]

m::read_lock::read_lock ( reader_writer_mutex rw_mutex)
inlineexplicit

Definition at line 325 of file reader_writer_lock.hpp.

References lock().

◆ read_lock() [2/5]

m::read_lock::read_lock ( reader_writer_mutex rw_mutex,
std::defer_lock_t   
)
inline

Definition at line 326 of file reader_writer_lock.hpp.

◆ read_lock() [3/5]

m::read_lock::read_lock ( reader_writer_mutex rw_mutex,
std::adopt_lock_t   
)
inline

Definition at line 327 of file reader_writer_lock.hpp.

◆ read_lock() [4/5]

m::read_lock::read_lock ( const read_lock )
delete

◆ read_lock() [5/5]

m::read_lock::read_lock ( read_lock &&  other)
inline

Definition at line 329 of file reader_writer_lock.hpp.

References swap.

◆ ~read_lock()

m::read_lock::~read_lock ( )
inline

Definition at line 331 of file reader_writer_lock.hpp.

References owns_lock(), and unlock().

Member Function Documentation

◆ lock()

void m::read_lock::lock ( )
inline

Definition at line 337 of file reader_writer_lock.hpp.

References M_insist, owns_lock(), owns_lock_, and rw_mutex_.

Referenced by read_lock().

◆ operator=()

read_lock & m::read_lock::operator= ( read_lock &&  other)
inline

Definition at line 333 of file reader_writer_lock.hpp.

References swap.

◆ owns_lock()

bool m::read_lock::owns_lock ( ) const
inline

Definition at line 335 of file reader_writer_lock.hpp.

References owns_lock_.

Referenced by lock(), m::upgrade_lock::owns_read_lock(), unlock(), and ~read_lock().

◆ unlock()

void m::read_lock::unlock ( )
inline

Definition at line 338 of file reader_writer_lock.hpp.

References M_insist, owns_lock(), owns_lock_, and rw_mutex_.

Referenced by ~read_lock().

Friends And Related Function Documentation

◆ swap

void swap ( read_lock first,
read_lock second 
)
friend

Definition at line 314 of file reader_writer_lock.hpp.

Referenced by operator=(), and read_lock().

Field Documentation

◆ owns_lock_

bool m::read_lock::owns_lock_ {false}
protected

Definition at line 322 of file reader_writer_lock.hpp.

Referenced by lock(), owns_lock(), unlock(), and m::upgrade_lock::upgrade().

◆ rw_mutex_

std::reference_wrapper<reader_writer_mutex> m::read_lock::rw_mutex_
protected

Definition at line 321 of file reader_writer_lock.hpp.

Referenced by lock(), unlock(), and m::upgrade_lock::upgrade().


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