24#ifndef LIBTHREADAR_CONDITION_HPP
25#define LIBTHREADAR_CONDITION_HPP
83 void wait(
unsigned int instance = 0);
92 void signal(
unsigned int instance = 0);
108 std::deque<pthread_cond_t> cond;
109 std::deque<unsigned int> counter;
Wrapper around the Posix pthread_cond_t object and its associated mutex.
condition(unsigned int num=1)
constructor
condition & operator=(const condition &ref)=delete
no assignment operator
unsigned int get_waiting_thread_count(unsigned int instance=0) const
return the number of thread currently waiting on that condition
condition(condition &&ref)=default
no move constructor
condition(const condition &ref)=delete
no copy constructor
void wait(unsigned int instance=0)
put the calling thread on hold waiting for another thread to call signal()
void signal(unsigned int instance=0)
awakes a single thread suspended for having called wait() on the condition given in argument
void broadcast(unsigned int instance=0)
awakes all threads suspended for having called wait() on the condition given in argument
Wrapper around the Posix pthread_mutex_t C objects.
defines a set of exceptions that are used by libthreadar to report error situations
defines the mutex C++ class
This is the only namespace used in libthreadar and all symbols provided by libthreadar are member of ...