2012-04-02 08:56:30 +02:00
|
|
|
#ifndef CONDVAR_H
|
|
|
|
#define CONDVAR_H
|
2012-03-31 09:09:40 +02:00
|
|
|
|
|
|
|
namespace icinga
|
|
|
|
{
|
|
|
|
|
|
|
|
class condvar
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
#ifdef _WIN32
|
|
|
|
CONDITION_VARIABLE m_CondVar;
|
|
|
|
#else /* _WIN32 */
|
|
|
|
pthread_cond_t m_CondVar;
|
|
|
|
#endif /* _WIN32 */
|
|
|
|
|
|
|
|
public:
|
|
|
|
condvar(void);
|
|
|
|
~condvar(void);
|
|
|
|
|
|
|
|
void wait(mutex *mtx);
|
|
|
|
void signal(void);
|
|
|
|
void broadcast(void);
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
CONDITION_VARIABLE *get(void);
|
|
|
|
#else /* _WIN32 */
|
|
|
|
pthread_cond_t *get(void);
|
|
|
|
#endif /* _WIN32 */
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-04-02 08:56:30 +02:00
|
|
|
#endif /* CONDVAR_H */
|