-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathstructevthread__condition__callbacks.html
More file actions
209 lines (193 loc) · 10.3 KB
/
structevthread__condition__callbacks.html
File metadata and controls
209 lines (193 loc) · 10.3 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.16.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libevent: evthread_condition_callbacks Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">libevent<span id="projectnumber"> 2.2.1</span>
</div>
<div id="projectbrief">Event notification library</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.16.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search/",'.html');
</script>
<script type="text/javascript">
$(function() { codefold.init(); });
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(function(){initNavTree('structevthread__condition__callbacks.html','',''); });
</script>
<div id="container">
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">evthread_condition_callbacks Struct Reference</div></div>
</div><!--header-->
<div class="contents">
<p>This structure describes the interface a threading library uses for condition variables.
<a href="#details">More...</a></p>
<p><code>#include <<a class="el" href="thread_8h_source.html">thread.h</a>></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-pub-attribs" class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:a36027843abf850371926b39ee2d6532a" id="r_a36027843abf850371926b39ee2d6532a"><td class="memItemLeft">void *(* </td><td class="memItemRight"><a class="el" href="#a36027843abf850371926b39ee2d6532a">alloc_condition</a> )(unsigned condtype)</td></tr>
<tr class="memdesc:a36027843abf850371926b39ee2d6532a"><td class="mdescLeft"> </td><td class="mdescRight">Function to allocate and initialize a new condition variable. <br /></td></tr>
<tr class="memitem:a632a051711c8f7728e3464721d7c8084" id="r_a632a051711c8f7728e3464721d7c8084"><td class="memItemLeft">int </td><td class="memItemRight"><a class="el" href="#a632a051711c8f7728e3464721d7c8084">condition_api_version</a></td></tr>
<tr class="memdesc:a632a051711c8f7728e3464721d7c8084"><td class="mdescLeft"> </td><td class="mdescRight">The current version of the conditions API. <br /></td></tr>
<tr class="memitem:af20b2614116b6ac43f3e25012a792575" id="r_af20b2614116b6ac43f3e25012a792575"><td class="memItemLeft"><a id="af20b2614116b6ac43f3e25012a792575" name="af20b2614116b6ac43f3e25012a792575"></a>
void(* </td><td class="memItemRight"><b>free_condition</b> )(void *cond)</td></tr>
<tr class="memdesc:af20b2614116b6ac43f3e25012a792575"><td class="mdescLeft"> </td><td class="mdescRight">Function to free a condition variable. <br /></td></tr>
<tr class="memitem:a453762d49a8fbcbe0f36b34dae478e8e" id="r_a453762d49a8fbcbe0f36b34dae478e8e"><td class="memItemLeft">int(* </td><td class="memItemRight"><a class="el" href="#a453762d49a8fbcbe0f36b34dae478e8e">signal_condition</a> )(void *cond, int broadcast)</td></tr>
<tr class="memdesc:a453762d49a8fbcbe0f36b34dae478e8e"><td class="mdescLeft"> </td><td class="mdescRight">Function to signal a condition variable. <br /></td></tr>
<tr class="memitem:aa7963135768612f74dfa80f15b6c7260" id="r_aa7963135768612f74dfa80f15b6c7260"><td class="memItemLeft">int(* </td><td class="memItemRight"><a class="el" href="#aa7963135768612f74dfa80f15b6c7260">wait_condition</a> )(void *cond, void *lock, const struct timeval *timeout)</td></tr>
<tr class="memdesc:aa7963135768612f74dfa80f15b6c7260"><td class="mdescLeft"> </td><td class="mdescRight">Function to wait for a condition variable. <br /></td></tr>
</table>
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This structure describes the interface a threading library uses for condition variables. </p>
<p>It's used to tell evthread_set_condition_callbacks how to use locking on this platform. </p>
</div><a name="doc-variable-members" id="doc-variable-members"></a><h2 id="header-doc-variable-members" class="groupheader">Field Documentation</h2>
<a id="a36027843abf850371926b39ee2d6532a" name="a36027843abf850371926b39ee2d6532a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a36027843abf850371926b39ee2d6532a">◆ </a></span>alloc_condition</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void *(* evthread_condition_callbacks::alloc_condition) (unsigned condtype)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Function to allocate and initialize a new condition variable. </p>
<p>Returns the condition variable on success, and NULL on failure. The 'condtype' argument will be 0 with this API version. </p>
</div>
</div>
<a id="a632a051711c8f7728e3464721d7c8084" name="a632a051711c8f7728e3464721d7c8084"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a632a051711c8f7728e3464721d7c8084">◆ </a></span>condition_api_version</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int evthread_condition_callbacks::condition_api_version</td>
</tr>
</table>
</div><div class="memdoc">
<p>The current version of the conditions API. </p>
<p>Set this to EVTHREAD_CONDITION_API_VERSION </p>
</div>
</div>
<a id="a453762d49a8fbcbe0f36b34dae478e8e" name="a453762d49a8fbcbe0f36b34dae478e8e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a453762d49a8fbcbe0f36b34dae478e8e">◆ </a></span>signal_condition</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int(* evthread_condition_callbacks::signal_condition) (void *cond, int broadcast)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Function to signal a condition variable. </p>
<p>If 'broadcast' is 1, all threads waiting on 'cond' should be woken; otherwise, only on one thread is worken. Should return 0 on success, -1 on failure. This function will only be called while holding the associated lock for the condition. </p>
</div>
</div>
<a id="aa7963135768612f74dfa80f15b6c7260" name="aa7963135768612f74dfa80f15b6c7260"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa7963135768612f74dfa80f15b6c7260">◆ </a></span>wait_condition</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int(* evthread_condition_callbacks::wait_condition) (void *cond, void *lock, const struct timeval *timeout)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Function to wait for a condition variable. </p>
<p>The lock 'lock' will be held when this function is called; should be released while waiting for the condition to be come signalled, and should be held again when this function returns. If timeout is provided, it is interval of seconds to wait for the event to become signalled; if it is NULL, the function should wait indefinitely.</p>
<p>The function should return -1 on error; 0 if the condition was signalled, or 1 on a timeout. </p>
</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>event2/<a class="el" href="thread_8h_source.html">thread.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="page-nav" class="page-nav-panel">
<div id="page-nav-resize-handle"></div>
<div id="page-nav-tree">
<div id="page-nav-contents">
</div><!-- page-nav-contents -->
</div><!-- page-nav-tree -->
</div><!-- page-nav -->
</div><!-- container -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a href="structevthread__condition__callbacks.html">evthread_condition_callbacks</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.16.1 </li>
</ul>
</div>
</body>
</html>