ADTF
Loading...
Searching...
No Matches
shared_mutex.h
Go to the documentation of this file.
1
14
15#ifndef A_UTIL_UTIL_CONCURRENCY_SHARED_MUTEX_HEADER_INCLUDED
16#define A_UTIL_UTIL_CONCURRENCY_SHARED_MUTEX_HEADER_INCLUDED
17
18#include <memory>
19
20namespace a_util {
21namespace concurrency {
26class shared_mutex {
27 shared_mutex(const shared_mutex&); // = delete;
28 shared_mutex& operator=(const shared_mutex&); // = delete;
29
30 struct impl;
31 std::unique_ptr<impl> p;
32
33public:
36
39
41 void lock();
42
47 bool try_lock();
48
50 void unlock();
51
54
60
63};
64
65} // namespace concurrency
66} // namespace a_util
67
68#endif // A_UTIL_UTIL_CONCURRENCY_SHARED_MUTEX_HEADER_INCLUDED
void lock()
Lock the mutex, blocks if the mutex is not available.
void unlock_shared()
Unlock the mutex (shared ownership)
~shared_mutex()
DTOR - does not call unlock!
void lock_shared()
Lock the mutex for shared ownership, blocks if the mutex is not available.
void unlock()
Unlock the mutex.
shared_mutex()
CTOR - creates the mutex in an unlocked state.
Definition concurrency.h:24
Serves as the root component, with common functionality documented in core functionality.
Definition base.h:24