ETL
0.04.19
Main Page
Related Pages
Classes
Files
File List
File Members
ETL
_condition.h
Go to the documentation of this file.
1
25
/* === S T A R T =========================================================== */
26
27
#ifndef __ETL__CONDITION_H_
28
#define __ETL__CONDITION_H_
29
30
/* === H E A D E R S ======================================================= */
31
32
/* === M A C R O S ========================================================= */
33
34
/* === C L A S S E S & S T R U C T S ======================================= */
35
36
_ETL_BEGIN_NAMESPACE
37
38
class
condition
:
private
mutex
39
{
40
bool
flag
;
41
public
:
42
condition
()
43
{
flag
=
false
; }
44
~condition
()
45
{ }
46
void
operator()
()
47
{
flag
=
true
; }
48
void
wait
()
49
{
50
mutex::lock
lock
(*
this
);
51
52
while
(!
flag
)
Yield
();
53
flag
=
false
;
54
}
55
void
wait_next
()
56
{
57
mutex::lock
lock
(*
this
);
58
59
flag
=
false
;
60
while
(!
flag
)
Yield
();
61
}
62
};
63
64
_ETL_END_NAMESPACE
65
66
/* === E X T E R N S ======================================================= */
67
68
/* === E N D =============================================================== */
69
70
#endif
Generated on Mon Nov 16 2015 15:32:02 for ETL by
1.8.1.2