35 [[nodiscard]]
int value()
const;
60 explicit inline Lock(
const Semaphore& semaphore,
bool tryWait =
false);
92 [[nodiscard]]
inline bool isAcquired()
const;
123 : _semaphore(nullptr)
127 : _semaphore(nullptr)
133 : _semaphore(nullptr)
146 return _semaphore !=
nullptr;
Locking class.
Definition Semaphore.h:41
bool acquire(const Semaphore &semaphore, const TimeSpec &timeout)
Waits to acquire the semaphore. Is called from the constructor. The timeout is the time the function ...
void release(bool relinquish=true)
Releases.
bool acquire(const Semaphore &semaphore, bool tryWait=false)
Waits to acquire the semaphore. Is also called from the constructor. When the 'tryWait' argument is t...
Lock()
Default constructor which sees to it that it is released.
Definition Semaphore.h:122
~Lock()
Destructor cleaning up.
Definition Semaphore.h:138
bool isAcquired() const
See if semaphore was acquired or timed-out.
Definition Semaphore.h:143
Semaphore class built around posix sem_xxx functionality.
Definition Semaphore.h:13
int value() const
Gets the semaphore integer value.
void release()
Called by Lock destructor.
handle_type _handle
Holds the semaphore handle/structure.
Definition Semaphore.h:119
~Semaphore()
Destructor cleaning up the allocated semaphore.
bool post()
Signals any thread which is locked.
Semaphore(int initialCount=0)
Constructor initializing the counter.
sem_t handle_type
Definition Semaphore.h:109
#define _MISC_CLASS
Definition misc/global.h:40
Definition Application.h:10
Class wrapper for timespec structure to modify.
Definition TimeSpec.h:12