#include <shared_spin_lock.h>
|
class | Guard |
| Sentry class for Shared_spin_lock to deliver RAII pattern usability. More...
|
|
◆ enum_lock_acquisition
Enumerator |
---|
SL_EXCLUSIVE | |
SL_SHARED | |
SL_NO_ACQUISITION | |
◆ Shared_spin_lock()
lock::Shared_spin_lock::Shared_spin_lock |
( |
| ) |
|
|
default |
Default class constructor.
◆ ~Shared_spin_lock()
virtual lock::Shared_spin_lock::~Shared_spin_lock |
( |
| ) |
|
|
virtualdefault |
Default class destructor.
◆ acquire_exclusive()
Blocks until the lock is acquired in exclusive mode.
- Returns
- A reference to
this
object, for chaining purposes.
◆ acquire_shared()
Blocks until the lock is acquired in shared mode.
- Returns
- A reference to
this
object, for chaining purposes.
◆ acquired_spins()
Returns the thread-local lock counter map.
◆ is_exclusive_acquisition()
bool lock::Shared_spin_lock::is_exclusive_acquisition |
( |
| ) |
|
Returns whether the lock is acquired for exclusive access by the invoking thread.
- Returns
- true if the lock was acquired in exclusive mode by the invoking thread
◆ is_shared_acquisition()
bool lock::Shared_spin_lock::is_shared_acquisition |
( |
| ) |
|
Returns whether the lock is acquired for shared access by the invoking thread.
- Returns
- true if the lock was acquired in shared mode by the invoking thread
◆ release_exclusive()
Releases the previously granted exclusive acquisition request.
- Returns
- A reference to
this
object, for chaining purposes.
◆ release_shared()
Releases the previously granted shared acquisition request.
- Returns
- A reference to
this
object, for chaining purposes.
◆ spin_exclusive_lock()
void lock::Shared_spin_lock::spin_exclusive_lock |
( |
| ) |
|
|
private |
Blocks until the lock is acquired in exclusive mode.
◆ spin_shared_lock()
void lock::Shared_spin_lock::spin_shared_lock |
( |
| ) |
|
|
private |
Blocks until the lock is acquired in shared mode.
◆ try_exclusive()
Tries to acquire the lock in exclusive mode.
- Returns
- A reference to
this
object, for chaining purposes.
◆ try_exclusive_lock()
bool lock::Shared_spin_lock::try_exclusive_lock |
( |
| ) |
|
|
private |
Tries to acquire in exclusive mode.
- Returns
true
if the attempt to acquire the lock in exclusive mode was successful.
◆ try_or_spin_exclusive_lock()
Tries to lock or waits for locking in shared mode and increases the thread-local lock acquisition shared counter.
- Parameters
-
try_and_fail | Whether or not to try to lock of wait for acquiring. |
- Returns
- A reference to
this
object, for chaining purposes.
◆ try_or_spin_shared_lock()
Tries to lock or waits for locking in shared mode and increases the thread-local lock acquisition shared counter.
- Parameters
-
try_and_fail | Whether or not to try to lock of wait for acquiring. |
- Returns
- A reference to
this
object, for chaining purposes.
◆ try_shared()
Tries to acquire the lock in shared mode.
- Returns
- A reference to
this
object, for chaining purposes.
◆ try_shared_lock()
bool lock::Shared_spin_lock::try_shared_lock |
( |
| ) |
|
|
private |
Tries to acquire in shared mode.
- Returns
true
if the attempt to acquire the lock in shared mode was successful.
◆ Shared_spin_lock::Guard
◆ m_exclusive_access
Whether or not any thread is accessing in or waiting for exclusive mode.
◆ m_shared_access
The total amount of threads accessing in shared mode
The documentation for this class was generated from the following files: