olp-cpp-sdk  1.22.0
Public Member Functions | List of all members
std::shared_mutex Class Reference

A shared mutex type that can be locked exclusively by one thread or shared non-exclusively by multiple threads. More...

#include <shared_mutex.h>

Public Member Functions

 shared_mutex (const shared_mutex &)=delete
 
shared_mutexoperator= (const shared_mutex &)=delete
 
void lock ()
 Takes ownership of the associated mutex.
 
bool try_lock ()
 Tries to take ownership of the mutex without blocking. More...
 
void unlock ()
 Releases the ownership of the mutex from the calling thread.
 
void lock_shared ()
 Blocks the calling thread until the thread obtains shared ownership of the mutex.
 
bool try_lock_shared ()
 Tries to take shared ownership of the mutex without blocking. More...
 
void unlock_shared ()
 Releases the shared ownership of the mutex from the calling thread.
 

Detailed Description

A shared mutex type that can be locked exclusively by one thread or shared non-exclusively by multiple threads.

Member Function Documentation

◆ try_lock()

bool std::shared_mutex::try_lock ( )
inline

Tries to take ownership of the mutex without blocking.

Returns
True if the method takes ownership; false otherwise.

◆ try_lock_shared()

bool std::shared_mutex::try_lock_shared ( )
inline

Tries to take shared ownership of the mutex without blocking.

Returns
True if the method takes ownership; false otherwise.

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