nlib
|
Class to wrap objects like CriticalSection
.
More...
#include "nn/nlib/threading/CriticalSection.h"
Public Types | |
typedef T | mutex_type |
T. | |
typedef mutex_type::native_handle_type | native_handle_type |
mutex_type::native_handle_type . | |
Public Member Functions | |
void | lock () NLIB_ACQUIRE() |
Locks the associated CriticalSection or other object. | |
void | unlock () noexcept NLIB_RELEASE() |
Unlocks the associated CriticalSection or other object. | |
NLIB_CHECK_RESULT bool | try_lock () noexcept NLIB_TRY_ACQUIRE(true) |
Attempts to lock the associated object like CriticalSection . | |
NLIB_CHECK_RESULT bool | try_lock_for (const TimeSpan &timeout) noexcept NLIB_TRY_ACQUIRE(true) |
Attempts to lock with timeout the associated CriticalSection or other object. | |
NLIB_CHECK_RESULT bool | try_lock_until (const DateTime &abstime) noexcept NLIB_TRY_ACQUIRE(true) |
Attempts to lock with timeout the associated CriticalSection or other object. | |
void | swap (UniqueLock &rhs) noexcept |
Attempts to swap the associated CriticalSection or other object. More... | |
mutex_type * | release () noexcept NLIB_RETURN_CAPABILITY(*locker_) |
Removes the association. Does not unlock. More... | |
mutex_type * | mutex () const noexcept NLIB_RETURN_CAPABILITY(*locker_) |
Gets the pointer to the associated object like CriticalSection . More... | |
native_handle_type | native_handle () NLIB_RETURN_CAPABILITY(*locker_) |
Returns an implementation-specific handle representing a lock. | |
bool | owns_lock () const noexcept |
Returns true if the lock associated with UniqueLock is locked. | |
operator bool () const | |
Returns true if the lock is held. | |
Basic Member Functions | |
UniqueLock () noexcept | |
Initializes an object without creating an association. | |
UniqueLock (mutex_type &rhs) NLIB_ACQUIRE(locker_) | |
Locks the object like CriticalSection and associates it with this object. More... | |
UniqueLock (mutex_type &rhs, AdoptLockType) NLIB_REQUIRES(locker_) | |
Assumes an object like CriticalSection is already locked, and initializes the object without locking it. Unlocked in the destructor. More... | |
UniqueLock (mutex_type &rhs, DeferLockType) noexcept NLIB_EXCLUDES(locker_) | |
Initializes an object without locking. More... | |
UniqueLock (mutex_type &rhs, TryToLockType) | |
Attempts to lock using try_lock when initializing. More... | |
UniqueLock & | assign (UniqueLock &rhs, move_tag) |
Assigns the object by using swap for a move. | |
UniqueLock (UniqueLock &rhs, move_tag) | |
Instantiates the object by using swap for a move. | |
UniqueLock (UniqueLock &&rhs) | |
Instantiates the object (move constructor). This function is useful when using C++11. | |
UniqueLock & | operator= (UniqueLock &&rhs) |
Move assignment operator. This function is useful when using C++11. | |
Class to wrap objects like CriticalSection
.
T | Classes such as CriticalSection . |
Definition at line 295 of file CriticalSection.h.
|
inlineexplicit |
Locks the object like CriticalSection
and associates it with this object.
[in] | rhs | Objects such as CriticalSection . |
Definition at line 300 of file CriticalSection.h.
|
inline |
Assumes an object like CriticalSection
is already locked, and initializes the object without locking it. Unlocked in the destructor.
[in] | rhs | Objects such as CriticalSection . |
Definition at line 304 of file CriticalSection.h.
|
inlinenoexcept |
Initializes an object without locking.
[in] | rhs | Objects such as CriticalSection . |
Definition at line 306 of file CriticalSection.h.
|
inline |
Attempts to lock using try_lock
when initializing.
[in] | rhs | Objects such as CriticalSection . |
Definition at line 309 of file CriticalSection.h.
|
inlinenoexcept |
Gets the pointer to the associated object like CriticalSection
.
CriticalSection
. Definition at line 370 of file CriticalSection.h.
|
inlinenoexcept |
Removes the association. Does not unlock.
CriticalSection
. Definition at line 364 of file CriticalSection.h.
|
inlinenoexcept |
Attempts to swap the associated CriticalSection
or other object.
[in] | rhs | Object to swap. |
Definition at line 359 of file CriticalSection.h.
© 2012-2016 Nintendo Co., Ltd. All rights reserved.