Lunchbox
1.8.0
|
A mutex with timeout capabilities. More...
#include <timedLock.h>
Public Member Functions | |
TimedLock () | |
Construct a new timed lock. | |
~TimedLock () | |
Destruct the lock. | |
bool | set (const uint32_t timeout=LB_TIMEOUT_INDEFINITE) |
Set the lock. | |
void | unset () |
Release the lock. | |
bool | trySet () |
Attempt to set the lock. | |
bool | isSet () |
Test if the lock is set. |
A mutex with timeout capabilities.
Definition at line 30 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.