![]() |
XTL
0.1
eXtended Template Library
|
A multiple reader/single writer spin lock supports 2^31 simultaneous readers. More...
Collaboration diagram for xtd::concurrent::rw_lock_base< _WaitPolicyT >:Data Structures | |
| class | scope_read |
| RAII pattern to acquire and release a read lock. More... | |
| class | scope_write |
| RAII pattern to acquire and release a write lock. More... | |
Public Types | |
| using | wait_policy_type = _WaitPolicyT |
Public Member Functions | |
| rw_lock_base (wait_policy_type oWait=wait_policy_type()) | |
| void | lock_read () |
| Acquires a shared read lock. | |
| void | lock_write () |
| acquires a write lock for exclusive access | |
| uint32_t | readers () const |
| Returns the number of active read locks. | |
| bool | try_lock_read () |
| tries to acquire a shared read lock More... | |
| bool | try_lock_write () |
| attempts to acquire a write lock for exclusive access More... | |
| void | unlock () |
| Frees the write lock or decrements the reader count. | |
A multiple reader/single writer spin lock supports 2^31 simultaneous readers.
| _WaitPolicyT | behavior when spinning |
Definition at line 16 of file rw_lock.hpp.
|
inline |
tries to acquire a shared read lock
Definition at line 57 of file rw_lock.hpp.
|
inline |
attempts to acquire a write lock for exclusive access
Definition at line 71 of file rw_lock.hpp.