-
Notifications
You must be signed in to change notification settings - Fork 4
/
structevthread__condition__callbacks.html
181 lines (165 loc) · 10.1 KB
/
structevthread__condition__callbacks.html
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
<!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">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<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>
<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 style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<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.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- 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">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<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="structevthread__condition__callbacks.html#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 class="groupheader"><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:a1112ef26fb2217351895c10ba347220c"><td class="memItemLeft" align="right" valign="top">void *(* </td><td class="memItemRight" valign="bottom"><a class="el" href="structevthread__condition__callbacks.html#a1112ef26fb2217351895c10ba347220c">alloc_condition</a> )(unsigned condtype)</td></tr>
<tr class="memdesc:a1112ef26fb2217351895c10ba347220c"><td class="mdescLeft"> </td><td class="mdescRight">Function to allocate and initialize a new condition variable. <a href="structevthread__condition__callbacks.html#a1112ef26fb2217351895c10ba347220c">More...</a><br /></td></tr>
<tr class="separator:a1112ef26fb2217351895c10ba347220c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a632a051711c8f7728e3464721d7c8084"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structevthread__condition__callbacks.html#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. <a href="structevthread__condition__callbacks.html#a632a051711c8f7728e3464721d7c8084">More...</a><br /></td></tr>
<tr class="separator:a632a051711c8f7728e3464721d7c8084"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af20b2614116b6ac43f3e25012a792575"><td class="memItemLeft" align="right" valign="top"><a id="af20b2614116b6ac43f3e25012a792575"></a>
void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="structevthread__condition__callbacks.html#af20b2614116b6ac43f3e25012a792575">free_condition</a> )(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="separator:af20b2614116b6ac43f3e25012a792575"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a453762d49a8fbcbe0f36b34dae478e8e"><td class="memItemLeft" align="right" valign="top">int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="structevthread__condition__callbacks.html#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. <a href="structevthread__condition__callbacks.html#a453762d49a8fbcbe0f36b34dae478e8e">More...</a><br /></td></tr>
<tr class="separator:a453762d49a8fbcbe0f36b34dae478e8e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa7963135768612f74dfa80f15b6c7260"><td class="memItemLeft" align="right" valign="top">int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="structevthread__condition__callbacks.html#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. <a href="structevthread__condition__callbacks.html#aa7963135768612f74dfa80f15b6c7260">More...</a><br /></td></tr>
<tr class="separator:aa7963135768612f74dfa80f15b6c7260"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 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><h2 class="groupheader">Field Documentation</h2>
<a id="a1112ef26fb2217351895c10ba347220c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1112ef26fb2217351895c10ba347220c">◆ </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"></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"></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"></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 -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>