4 #ifndef __FRIOS_POSIX_THREADS_COND_HPP__
5 #define __FRIOS_POSIX_THREADS_COND_HPP__
40 int fail = pthread_cond_init(&_cond, 0);
50 int fail = pthread_cond_init(&_cond, &attributes._attr);
56 : _cond(std::move(tmp._cond))
63 pthread_cond_destroy(&_cond);
69 pthread_cond_wait(&_cond, lock._p_mutex);
75 pthread_cond_signal(&_cond);
81 pthread_cond_broadcast(&_cond);
88 #endif // include guard
Wrapper around POSIX condition variable attributes.
Definition: cond_attr.hpp:18
Wraper around POSIX condition variables.
Definition: cond.hpp:18
void wait(mutex::lock &lock)
Wait on the condition variable.
Definition: cond.hpp:67
Wrapper around POSIX mutexes.
cond(void)
Default constructor of the condition variable.
Definition: cond.hpp:38
Base class for all POSIX exceptions.
Definition: error.hpp:14
void signal(void)
Signal on the condition variable.
Definition: cond.hpp:73
~cond(void)
Destructor frees the resources asociated with the condition variable.
Definition: cond.hpp:60
Class locking a mutex on construction and unlocking on destruction.
Definition: mutex.hpp:133
Wrapper around POSIX condition variable attributes.
Declaration of exception classes for POSIX errors.
cond(cond &&tmp)
Condition variables are movable.
Definition: cond.hpp:55
cond(const cond_attr &attributes)
Construction of a condition variable with the specified attributes.
Definition: cond.hpp:48
void broadcast(void)
Broadcast on the condition variable.
Definition: cond.hpp:79
Exception class for condition variable initialization error.
Definition: cond.hpp:27
error(int error_code)
Construction from POSIX error code.
Definition: error.hpp:26