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