nlib
|
Implements a read/write lock. Used when multiple threads simultaneously read data, and a single thread writes data. More...
#include "nn/nlib/threading/SharedCriticalSection.h"
Public Member Functions | |
constexpr | SharedCriticalSection () noexcept |
Instantiates the object with default parameters (default constructor). | |
void | lock_shared () noexcept NLIB_SHARED_LOCK_FUNC() |
Gets the read lock, and enters the critical section. Blocks until it can get a lock. | |
bool | try_lock_shared () noexcept NLIB_SHARED_TRYLOCK_FUNC(true) |
Gets the read lock, and attempts to enter the critical section. More... | |
bool | try_lock_shared_for (const TimeSpan &timeout) noexcept NLIB_SHARED_TRYLOCK_FUNC(true) |
Gets the read lock, and attempts to enter the critical section. Times out. More... | |
bool | try_lock_shared_until (const DateTime &abstime) noexcept NLIB_SHARED_TRYLOCK_FUNC(true) |
Gets the read lock, and attempts to enter the critical section. Times out. More... | |
void | unlock_shared () noexcept NLIB_SHARED_UNLOCK_FUNC() |
Releases the read lock. | |
void | lock () noexcept NLIB_LOCK_FUNC() |
Gets a write lock, and enters the critical section. Blocks until it can get a lock. | |
bool | try_lock () noexcept NLIB_TRYLOCK_FUNC(true) |
Gets a write lock, and attempts to enter the critical section. More... | |
bool | try_lock_for (const TimeSpan &timeout) noexcept NLIB_TRYLOCK_FUNC(true) |
Gets a write lock, and attempts to enter the critical section. Times out. More... | |
bool | try_lock_until (const DateTime &abstime) noexcept NLIB_TRYLOCK_FUNC(true) |
Gets a write lock, and attempts to enter the critical section. Times out. More... | |
void | unlock () noexcept NLIB_UNLOCK_FUNC() |
Releases a write lock. | |
Implements a read/write lock. Used when multiple threads simultaneously read data, and a single thread writes data.
CriticalSection
when the threads reading data do not need to be excluded from each other. Definition at line 12 of file SharedCriticalSection.h.
|
inlinenoexcept |
Gets a write lock, and attempts to enter the critical section.
true
if a lock is acquired. Definition at line 63 of file SharedCriticalSection.h.
|
inlinenoexcept |
Gets a write lock, and attempts to enter the critical section. Times out.
[in] | timeout | Specifies the time until timeout. |
true
if a lock is acquired. Definition at line 68 of file SharedCriticalSection.h.
|
inlinenoexcept |
Gets the read lock, and attempts to enter the critical section.
true
if a lock is acquired. Definition at line 35 of file SharedCriticalSection.h.
|
inlinenoexcept |
Gets the read lock, and attempts to enter the critical section. Times out.
[in] | timeout | Specifies the time until timeout. |
true
if a lock is acquired. Definition at line 40 of file SharedCriticalSection.h.
|
inlinenoexcept |
Gets the read lock, and attempts to enter the critical section. Times out.
[in] | abstime | The time when the timeout occurs. |
true
if a lock is acquired. Definition at line 46 of file SharedCriticalSection.h.
|
inlinenoexcept |
Gets a write lock, and attempts to enter the critical section. Times out.
[in] | abstime | The time when the timeout occurs. |
true
if a lock is acquired. Definition at line 73 of file SharedCriticalSection.h.
© 2013, 2014, 2015 Nintendo Co., Ltd. All rights reserved.