1 #ifndef CARMA_UTIL_PTHREAD_COND_H
2 #define CARMA_UTIL_PTHREAD_COND_H
6 #include "carma/util/PthreadMutex.h"
12 void broadcastCond( ::pthread_cond_t & c );
15 void signalCond( ::pthread_cond_t & c );
18 void waitCond( ::pthread_cond_t & c,
19 ::pthread_mutex_t & m );
21 void waitCond( ::pthread_cond_t & c,
25 bool timedWaitCond( ::pthread_cond_t & c,
26 ::pthread_mutex_t & m,
27 const struct ::timespec & abstime );
29 bool timedWaitCond( ::pthread_cond_t & c,
31 const struct ::timespec & abstime );
34 class PthreadCondAttr;
60 explicit PthreadCond( const ::pthread_condattr_t & attr );
110 void Wait( ::pthread_mutex_t & m );
133 const struct ::timespec & abstime );
146 const struct ::timespec & abstime );
178 ::pthread_cond_t cond_;
195 const struct ::timespec & abstime )
201 inline const ::pthread_cond_t &
208 inline ::pthread_cond_t &
216 carma::util::waitCond( ::pthread_cond_t & c,
224 carma::util::timedWaitCond( ::pthread_cond_t & c,
226 const struct ::timespec & abstime )
228 return timedWaitCond( c, m.InternalPthreadMutex(), abstime );
const ::pthread_cond_t & InternalPthreadCond() const
Obtain a reference to the internal ::pthread_cond_t.
void Signal()
Wake one of any waiters.
A simple wrapper class that makes use of ::pthread_cond_t easier in a C++ world.
void Broadcast()
Wake any waiters.
PthreadCond()
Default construct a cond with the CARMA defaults.
bool TimedWait(::pthread_mutex_t &m, const struct::timespec &abstime)
Wait until waken or timed out.
void Wait(::pthread_mutex_t &m)
Wait until waken.
A simple wrapper class that makes use of ::pthread_mutex_t easier in a C++ world. ...
A simple wrapper class that makes use of ::pthread_condattr_t easier in a C++ world.
const ::pthread_mutex_t & InternalPthreadMutex() const
Obtain a reference to the internal ::pthread_mutex_t.