nlib
nn::nlib::threading::TimedCriticalSection Class Reference

Critical section that can timeout in reentrant. More...

#include "nn/nlib/threading/CriticalSection.h"

Public Types

typedef nlib_mutexnative_handle_type
 typedef to a pointer type to a native mutex.
 

Public Member Functions

constexpr TimedCriticalSection () noexcept
 Instantiates the object with default parameters (default constructor).
 
bool try_lock_for (const TimeSpan &span) noexcept
 Gets a lock, and attempts to enter the critical section. Times out. More...
 
bool try_lock_until (const DateTime &abstime) noexcept
 Gets a lock, and attempts to enter the critical section. Times out. More...
 
void lock () noexcept
 Gets a lock, and enters the critical section. Blocks until it can get a lock.
 
void unlock () noexcept
 Releases the lock, and exits the critical section.
 
bool try_lock () noexcept
 Gets a lock, and attempts to enter the critical section. More...
 
native_handle_type native_handle () noexcept
 Gets a pointer to a native type mutex. More...
 

Detailed Description

Critical section that can timeout in reentrant.

Description
Corresponds to std::recursive_timed_mutex in C++11.

Definition at line 93 of file CriticalSection.h.

Member Function Documentation

nn::nlib::threading::TimedCriticalSection::native_handle ( )
inlinenoexcept

Gets a pointer to a native type mutex.

Returns
The pointer to the mutex.

Definition at line 125 of file CriticalSection.h.

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 118 of file CriticalSection.h.

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]spanSpecifies the timeout.
Returns
Returns true if a lock is acquired.
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]abstimeThe time when the timeout occurs.
Returns
Returns true if a lock is acquired.

The documentation for this class was generated from the following files: