blob: 87d576cc00d65e2ceae7c6cafce64511c597fc3a (
plain)
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
|
#pragma once
namespace threads
{
namespace impl
{
class ConditionImpl;
}
/// Implements mutexed condition semantics
class Condition
{
impl::ConditionImpl * m_pImpl;
Condition(Condition const &);
Condition & operator=(Condition const &);
public:
Condition();
~Condition();
void Signal(bool broadcast = false);
void Wait();
void Lock();
void Unlock();
};
/// ScopeGuard wrapper around mutex
class ConditionGuard
{
private:
Condition & m_Condition;
public:
ConditionGuard(Condition & condition);
~ConditionGuard();
void Wait();
void Signal(bool broadcast = false);
};
}
|