Lunchbox
1.15.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
|
A mutex with timeout capabilities. More...
#include <timedLock.h>
Public Member Functions | |
TimedLock () | |
Construct a new timed lock. More... | |
~TimedLock () | |
Destruct the lock. More... | |
bool | set (const uint32_t timeout=LB_TIMEOUT_INDEFINITE) |
Set the lock. More... | |
void | unset () |
Release the lock. More... | |
bool | trySet () |
Attempt to set the lock. More... | |
bool | isSet () |
Test if the lock is set. More... | |
A mutex with timeout capabilities.
Example:
Definition at line 35 of file timedLock.h.
lunchbox::TimedLock::TimedLock | ( | ) |
Construct a new timed lock.
lunchbox::TimedLock::~TimedLock | ( | ) |
Destruct the lock.
bool lunchbox::TimedLock::isSet | ( | ) |
Test if the lock is set.
bool lunchbox::TimedLock::set | ( | const uint32_t | timeout = LB_TIMEOUT_INDEFINITE | ) |
Set the lock.
timeout | the timeout in milliseconds to wait for the lock, or LB_TIMEOUT_INDEFINITE to wait indefinitely. |
bool lunchbox::TimedLock::trySet | ( | ) |
Attempt to set the lock.
void lunchbox::TimedLock::unset | ( | ) |
Release the lock.