2012-04-02 08:56:30 +02:00
|
|
|
#ifndef CONDVAR_H
|
|
|
|
#define CONDVAR_H
|
2012-03-31 09:09:40 +02:00
|
|
|
|
|
|
|
namespace icinga
|
|
|
|
{
|
|
|
|
|
2012-04-06 08:56:52 +02:00
|
|
|
class I2_BASE_API condvar
|
2012-03-31 09:09:40 +02:00
|
|
|
{
|
|
|
|
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 */
|