Lunchbox  1.8.0
Public Member Functions | List of all members
lunchbox::TimedLock Class Reference

A mutex with timeout capabilities. More...

#include <timedLock.h>

+ Inheritance diagram for lunchbox::TimedLock:
+ Collaboration diagram for lunchbox::TimedLock:

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.

Detailed Description

A mutex with timeout capabilities.

Definition at line 30 of file timedLock.h.

Constructor & Destructor Documentation

lunchbox::TimedLock::TimedLock ( )

Construct a new timed lock.

Version
1.0
lunchbox::TimedLock::~TimedLock ( )

Destruct the lock.

Version
1.0

Member Function Documentation

bool lunchbox::TimedLock::isSet ( )

Test if the lock is set.

Returns
true if the lock is set, false if it is not set.
Version
1.0
bool lunchbox::TimedLock::set ( const uint32_t  timeout = LB_TIMEOUT_INDEFINITE)

Set the lock.

Parameters
timeoutthe timeout in milliseconds to wait for the lock, or LB_TIMEOUT_INDEFINITE to wait indefinitely.
Returns
true if the lock was acquired, false if not.
Version
1.0
bool lunchbox::TimedLock::trySet ( )

Attempt to set the lock.

Returns
true if the lock was acquired, false if not.
Version
1.0
void lunchbox::TimedLock::unset ( )

Release the lock.

Version
1.0

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