-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWaitCondition.h
44 lines (31 loc) · 956 Bytes
/
WaitCondition.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/***************************************************************************
WaitCondition.h - description
-------------------
begin : Sat Mar 12 2011
copyright : (C) 2011 by Knut-Helge Vik
email : knuthelge@vik.gs
***************************************************************************/
#pragma once
#include "BaseLib/Mutex.h"
#ifdef WIN32
#include <process.h>
#endif
#include "BaseLib/Export.h"
namespace BaseLib {
class Mutex;
class WaitConditionPrivate;
class ReadWriteLock;
class DLL_STATE WaitCondition
{
public:
WaitCondition();
~WaitCondition();
bool wait(Mutex* mutex, int64 milliseconds = LONG_MAX);
bool wait(ReadWriteLock* readWriteLock, int64 milliseconds = LONG_MAX);
void wakeAll();
void wakeOne();
int numWaiters() const;
private:
std::shared_ptr<WaitConditionPrivate> self;
};
}