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 () |
Locks the associated CriticalSection or other object. | |
void | unlock () noexcept |
Unlocks the associated CriticalSection or other object. | |
bool | try_lock () noexcept |
Attempts to lock the associated object like CriticalSection . | |
bool | try_lock_for (const TimeSpan &timeout) noexcept |
Attempts to lock with timeout the associated CriticalSection or other object. | |
bool | try_lock_until (const DateTime &abstime) noexcept |
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 |
Removes the association. Does not unlock. More... | |
mutex_type * | mutex () const noexcept |
Gets the pointer to the associated object like CriticalSection . More... | |
native_handle_type | native_handle () |
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) | |
Locks the object like CriticalSection and associates it with this object. More... | |
UniqueLock (mutex_type &rhs, AdoptLockType) | |
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 | |
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 275 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 280 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 283 of file CriticalSection.h.
|
inlinenoexcept |
Initializes an object without locking.
[in] | rhs | Objects such as CriticalSection . |
Definition at line 286 of file CriticalSection.h.
|
inline |
Attempts to lock using try_lock
when initializing.
[in] | rhs | Objects such as CriticalSection . |
Definition at line 289 of file CriticalSection.h.
|
inlinenoexcept |
Gets the pointer to the associated object like CriticalSection
.
CriticalSection
. Definition at line 347 of file CriticalSection.h.
|
inlinenoexcept |
Removes the association. Does not unlock.
CriticalSection
. Definition at line 341 of file CriticalSection.h.
|
inlinenoexcept |
Attempts to swap the associated CriticalSection
or other object.
[in] | rhs | Object to swap. |
Definition at line 336 of file CriticalSection.h.
© 2013, 2014, 2015 Nintendo Co., Ltd. All rights reserved.