24#ifndef LIBTHREADAR_SEMAPHORE_HPP
25#define LIBTHREADAR_SEMAPHORE_HPP
Wrapper around the Posix pthread_mutex_t C objects.
Class semaphore is an enhanced version of Posix semaphore.
semaphore(const semaphore &ref)=delete
no copy constructor
bool working_thread() const
return whether the semaphore has at least one thread that acquired the lock, possibily without other ...
semaphore(unsigned int max_value)
semaphore constuctor
semaphore(semaphore &&ref) noexcept=default
no move constructor
void lock()
Request a "resource".
int get_value() const
Return the value of the semaphore, that's to say the number of available "resources".
bool waiting_thread() const
Return whether the semaphore has at least a pending thread waiting for another thread to unlock it.
void reset()
Reset to initial state releasing any thread that could wait on the semaphore.
semaphore & operator=(const semaphore &ref)=delete
no assignment operator
void unlock()
Release a "resource".
defines the mutex C++ class
This is the only namespace used in libthreadar and all symbols provided by libthreadar are member of ...