Mir
Public Types | Public Member Functions | List of all members
mir::PosixRWMutex Class Reference

Implementation of the Mutex and SharedMutex C++14 concepts via POSIX pthread rwlock. More...

#include <posix_rw_mutex.h>

Public Types

enum  Type { Type::Default, Type::PreferReader, Type::PreferWriterNonRecursive }
 

Public Member Functions

 PosixRWMutex ()
 
 PosixRWMutex (Type type)
 
 ~PosixRWMutex ()
 
 PosixRWMutex (PosixRWMutex const &)=delete
 
PosixRWMutexoperator= (PosixRWMutex const &)=delete
 
void lock_shared ()
 
bool try_lock_shared ()
 
void unlock_shared ()
 
void lock ()
 
bool try_lock ()
 
void unlock ()
 

Detailed Description

Implementation of the Mutex and SharedMutex C++14 concepts via POSIX pthread rwlock.

The advantages of using this over std::shared_timed_mutex are: a) The type of rwlock can be selected (as per pthread_rwlock_attr_setkind_np) b) As per POSIX, read locks are recursive rather than undefined behaviour

Member Enumeration Documentation

Enumerator
Default 
PreferReader 
PreferWriterNonRecursive 

Constructor & Destructor Documentation

mir::PosixRWMutex::PosixRWMutex ( )
mir::PosixRWMutex::PosixRWMutex ( Type  type)
mir::PosixRWMutex::~PosixRWMutex ( )
mir::PosixRWMutex::PosixRWMutex ( PosixRWMutex const &  )
delete

Member Function Documentation

void mir::PosixRWMutex::lock ( )
void mir::PosixRWMutex::lock_shared ( )
PosixRWMutex& mir::PosixRWMutex::operator= ( PosixRWMutex const &  )
delete
bool mir::PosixRWMutex::try_lock ( )
bool mir::PosixRWMutex::try_lock_shared ( )
void mir::PosixRWMutex::unlock ( )
void mir::PosixRWMutex::unlock_shared ( )

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

Copyright © 2012-2016 Canonical Ltd.
Generated on Tue Oct 31 05:57:28 UTC 2017