File: Event.html

package info (click to toggle)
libape 1.0.0-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,572 kB
  • ctags: 1,343
  • sloc: sh: 7,342; cpp: 3,418; makefile: 117
file content (90 lines) | stat: -rw-r--r-- 2,677 bytes parent folder | download
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<HTML><HEAD><TITLE>Event Class</TITLE></HEAD>
<BODY bgcolor="#ffffff">

<H1>Event Class Reference</H1>
<p>
[<A HREF="index.html">APE Index</A>] [<A HREF="hier.html">APE Hierarchy</A>]
[<A HREF="header-list.html">Headers</A>]
</p>
<HR>
<P>Thread synchornization on event notification.   <a href="#short">More...</a></P>
<P>
<code>
	#include &lt;<a href="thread-h.html">thread.h</a>&gt;
</code>

</P>

<P>
Inherits: <a href="Mutex.html">Mutex</a>
<P>
<H2>Public Members</H2>
<UL>
<LI> <b><a name="ref0">Event</a></b> () 
</LI>
<LI> <b><a name="ref1">~Event</a></b> () 
</LI>
<LI>void <b><a href="#ref2">Reset</a></b> (void) 
</LI>
<LI>void <b><a href="#ref3">Signal</a></b> (void) 
</LI>
<LI>bool <b><a href="#ref4">Wait</a></b> (timeout_t timer = 0) 
</LI>
</UL>

<H2>Protected Members</H2>
<UL>
<LI>	pthread_cond_t <b><a name="ref5">_cond</a></b>
</LI>
<LI>	bool <b><a name="ref6">_signaled</a></b>
</LI>
<LI>	int <b><a name="ref7">_count</a></b>
</LI>
</UL>
<HR>
<H2><a name="short">Detailed Description</a></H2>
<P>

 The APE Event class implements a feature originally found in the WIN32 API;
 event notification.  A target thread waits on a resetable Event, and one
 or more other threads can then signal the waiting thread to resume 
 execution.  A timeout can be used to specify a wait duration in 
 milliseconds.  The Event class must be reset before it can be used again 
 as a trigger.
 
 @author: David Sugar <dyfet@ostel.com>

</P><HR>
<H3><b>void <a name="ref2"></a><a name="Reset">Reset</a>(void)  </b><code>[public]</code></H3>
<p>Once signaled, the Event class must be "reset" before responding
to a new signal.
</p><p>
</p>
<dl><dt><b>See Also</b>:<dd><a href="Event.html#Signal">Signal</a></dl>
<H3><b>void <a name="ref3"></a><a name="Signal">Signal</a>(void)  </b><code>[public]</code></H3>
<p>Signal the event for the waiting thread.
</p>
<H3><b>bool <a name="ref4"></a><a name="Wait">Wait</a>(timeout_t timer = 0)  </b><code>[public]</code></H3>
<p>Wait either for the event to be signaled by another thread or
for the specified timeout duration.
</p><p>
</p>
<dl><dt><b>Parameters</b>:<dd>
<table width="100%" border="0">
<tr><td align="left" valign="top">
timer</td><td align="left" valign="top">
timeout in milliseconds to wait for a signal.</td></tr>
</table>
</dl>
<dl><dt><b>Returns</b>:<dd>
true if signaled, false if timed out.</dl>
<dl><dt><b>See Also</b>:<dd><a href="Event.html#Signal">Signal</a></dl>
<HR>
<TABLE WIDTH="100%"><TR><TD ALIGN="left" VALIGN="top">
<address>Documentation generated by dyfet@home.sys on Thu Dec 16 09:54:26 EST 1999
<address>
</TD><TD ALIGN="RIGHT" VALIGN="TOP">
<b>K</b><i>doc</i>
</TD>
</TR></TABLE></BODY></HTML>