mirror of https://github.com/Icinga/icinga2.git
34 lines
459 B
C++
34 lines
459 B
C++
#ifndef CONDVAR_H
|
|
#define CONDVAR_H
|
|
|
|
namespace icinga
|
|
{
|
|
|
|
class I2_BASE_API 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 */
|
|
};
|
|
|
|
}
|
|
|
|
#endif /* CONDVAR_H */
|