Critical section that can timeout in reentrant.
More...
#include "nn/nlib/threading/CriticalSection.h"
|
constexpr | TimedCriticalSection () noexcept=default |
| Instantiates the object with default parameters (default constructor).
|
|
bool | try_lock_for (const TimeSpan &span) noexcept NLIB_TRY_ACQUIRE(true) |
| Gets a lock, and attempts to enter the critical section. Times out. More...
|
|
bool | try_lock_until (const DateTime &abstime) noexcept NLIB_TRY_ACQUIRE(true) |
| Gets a lock, and attempts to enter the critical section. Times out. More...
|
|
void | lock () noexcept NLIB_ACQUIRE() |
| Gets a lock, and enters the critical section. Blocks until it can get a lock.
|
|
void | unlock () noexcept NLIB_RELEASE() |
| Releases the lock, and exits the critical section.
|
|
NLIB_CHECK_RESULT bool | try_lock () noexcept NLIB_TRY_ACQUIRE(true) |
| Gets a lock, and attempts to enter the critical section. More...
|
|
native_handle_type | native_handle () noexcept NLIB_RETURN_CAPABILITY(mutex_) |
| Gets a pointer to a native type mutex. More...
|
|
Critical section that can timeout in reentrant.
- Description
- Corresponds to
std::recursive_timed_mutex
in C++11.
Definition at line 103 of file CriticalSection.h.
§ native_handle()
nn::nlib::threading::TimedCriticalSection::native_handle |
( |
| ) |
|
|
inlinenoexcept |
Gets a pointer to a native type mutex.
- Returns
- The pointer to the mutex.
Definition at line 135 of file CriticalSection.h.
§ try_lock()
nn::nlib::threading::TimedCriticalSection::try_lock |
( |
| ) |
|
|
inlinenoexcept |
Gets a lock, and attempts to enter the critical section.
- Returns
- Returns
true
if a lock is acquired.
Definition at line 128 of file CriticalSection.h.
§ try_lock_for()
nn::nlib::threading::TimedCriticalSection::try_lock_for |
( |
const TimeSpan & |
span | ) |
|
|
noexcept |
Gets a lock, and attempts to enter the critical section. Times out.
- Parameters
-
[in] | span | Specifies the timeout. |
- Returns
- Returns
true
if a lock is acquired.
§ try_lock_until()
nn::nlib::threading::TimedCriticalSection::try_lock_until |
( |
const DateTime & |
abstime | ) |
|
|
noexcept |
Gets a lock, and attempts to enter the critical section. Times out.
- Parameters
-
[in] | abstime | The time when the timeout occurs. |
- Returns
- Returns
true
if a lock is acquired.
The documentation for this class was generated from the following files: