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=default |
Instantiates the object with default parameters (default constructor). | |
void | lock_shared () noexcept NLIB_ACQUIRE_SHARED() |
Gets the read lock, and enters the critical section. Blocks until it can get a lock. | |
NLIB_CHECK_RESULT bool | try_lock_shared () noexcept NLIB_TRY_ACQUIRE_SHARED(true) |
Gets the read lock, and attempts to enter the critical section. More... | |
NLIB_CHECK_RESULT bool | try_lock_shared_for (const TimeSpan &timeout) noexcept NLIB_TRY_ACQUIRE_SHARED(true) |
Gets the read lock, and attempts to enter the critical section. Times out. More... | |
NLIB_CHECK_RESULT bool | try_lock_shared_until (const DateTime &abstime) noexcept NLIB_TRY_ACQUIRE_SHARED(true) |
Gets the read lock, and attempts to enter the critical section. Times out. More... | |
void | unlock_shared () noexcept NLIB_RELEASE_SHARED() |
Releases the read lock. | |
void | lock () noexcept NLIB_ACQUIRE() |
Gets a write lock, and enters the critical section. Blocks until it can get a lock. | |
NLIB_CHECK_RESULT bool | try_lock () noexcept NLIB_TRY_ACQUIRE(true) |
Gets a write lock, and attempts to enter the critical section. More... | |
NLIB_CHECK_RESULT bool | try_lock_for (const TimeSpan &timeout) noexcept NLIB_TRY_ACQUIRE(true) |
Gets a write lock, and attempts to enter the critical section. Times out. More... | |
NLIB_CHECK_RESULT bool | try_lock_until (const DateTime &abstime) noexcept NLIB_TRY_ACQUIRE(true) |
Gets a write lock, and attempts to enter the critical section. Times out. More... | |
void | unlock () noexcept NLIB_RELEASE() |
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 25 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 75 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 80 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 47 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 52 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 58 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 86 of file SharedCriticalSection.h.
© 2012-2017 Nintendo Co., Ltd. All rights reserved.