|
Internal Interface Wrap
API reference
|
Reader-writer mutex using two regular mutexes + atomic counters. More...
#include <PlatformMutex.h>
Public Member Functions | |
| PlatformSharedMutexImpl () noexcept | |
| ~PlatformSharedMutexImpl () noexcept | |
| PlatformSharedMutexImpl (const PlatformSharedMutexImpl &)=delete | |
| PlatformSharedMutexImpl & | operator= (const PlatformSharedMutexImpl &)=delete |
| PlatformSharedMutexImpl (PlatformSharedMutexImpl &&other) noexcept | |
| PlatformSharedMutexImpl & | operator= (PlatformSharedMutexImpl &&other) noexcept |
| bool | lock () noexcept |
| bool | try_lock () noexcept |
| bool | try_lock_for (uint32_t timeout_ms) noexcept |
| void | unlock () noexcept |
| bool | lock_shared () noexcept |
| bool | try_lock_shared () noexcept |
| bool | try_lock_shared_for (uint32_t timeout_ms) noexcept |
| void | unlock_shared () noexcept |
Private Attributes | |
| Backend::MutexHandle | writer_mutex_ |
| Backend::MutexHandle | reader_mutex_ |
| std::atomic< int > | readers_ |
| std::atomic< bool > | writer_active_ |
Reader-writer mutex using two regular mutexes + atomic counters.
Multiple readers can hold the lock concurrently; writers have exclusive access. When Backend = NullMutexBackend, all operations compile away.
| Backend | Static policy class satisfying the NullMutexBackend contract. |
|
inlinenoexcept |
|
inlinenoexcept |
|
delete |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
delete |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
private |
|
private |
|
private |
|
private |