/usr/share/doc/libucommon-dev/a00132.html is in libucommon-doc 3.2.0-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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"/>
<title>UCommon: ucc::semaphore Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="classes.html"><span>Data Structure Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Data Fields</span></a></li>
</ul>
</div>
<div class="navpath"><a class="el" href="a00214.html">ucc</a>::<a class="el" href="a00132.html">semaphore</a>
</div>
</div>
<div class="contents">
<h1>ucc::semaphore Class Reference</h1><!-- doxytag: class="ucc::semaphore" --><!-- doxytag: inherits="ucc::Shared,ucc::Conditional" -->
<p>A portable counting semaphore class.
<a href="#_details">More...</a></p>
<p><code>#include <<a class="el" href="a00208_source.html">thread.h</a>></code></p>
<div class="dynheader">
Inheritance diagram for ucc::semaphore:</div>
<div class="dynsection">
<div class="center"><img src="a00517.png" border="0" usemap="#ucc_1_1semaphore_inherit__map" alt="Inheritance graph"/></div>
<map name="ucc_1_1semaphore_inherit__map" id="ucc_1_1semaphore_inherit__map">
<area shape="rect" id="node2" href="a00135.html" title="An exclusive locking protocol interface base." alt="" coords="5,5,104,35"/><area shape="rect" id="node4" href="a00040.html" title="The conditional is a common base for other thread synchronizing classes." alt="" coords="128,5,251,35"/></map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for ucc::semaphore:</div>
<div class="dynsection">
<div class="center"><img src="a00518.png" border="0" usemap="#ucc_1_1semaphore_coll__map" alt="Collaboration graph"/></div>
<map name="ucc_1_1semaphore_coll__map" id="ucc_1_1semaphore_coll__map">
<area shape="rect" id="node2" href="a00135.html" title="An exclusive locking protocol interface base." alt="" coords="5,5,104,35"/><area shape="rect" id="node4" href="a00040.html" title="The conditional is a common base for other thread synchronizing classes." alt="" coords="128,5,251,35"/></map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned </td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#a74da3bd63a2c8393912a95fc9a5fe12a">getCount</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get active semaphore limit. <a href="#a74da3bd63a2c8393912a95fc9a5fe12a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned </td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#a77b6c287d5ec5f6fcde9bf10616a17b0">getUsed</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get current semaphore usage. <a href="#a77b6c287d5ec5f6fcde9bf10616a17b0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8915c76460248620d644d6acb5bda668"></a><!-- doxytag: member="ucc::semaphore::operator++" ref="a8915c76460248620d644d6acb5bda668" args="(void)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#a8915c76460248620d644d6acb5bda668">operator++</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convenience operator to wait on a counting semaphore. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4776718b7fc5bd693be9dfc38dcf6bf6"></a><!-- doxytag: member="ucc::semaphore::operator--" ref="a4776718b7fc5bd693be9dfc38dcf6bf6" args="(void)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#a4776718b7fc5bd693be9dfc38dcf6bf6">operator--</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convenience operator to release a counting semaphore. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a884c8c2b1a5cf2df607cffb668b447fb"></a><!-- doxytag: member="ucc::semaphore::release" ref="a884c8c2b1a5cf2df607cffb668b447fb" args="(void)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#a884c8c2b1a5cf2df607cffb668b447fb">release</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Release the semaphore after waiting for it. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a996989b2746987ea13ca87bdbe72d57d"></a><!-- doxytag: member="ucc::semaphore::semaphore" ref="a996989b2746987ea13ca87bdbe72d57d" args="(unsigned count=0)" -->
</td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#a996989b2746987ea13ca87bdbe72d57d">semaphore</a> (unsigned count=0)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Construct a semaphore with an initial count of threads to permit. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#a163f5fa658c22a8581f802f48ec76dc8">set</a> (unsigned count)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Alter semaphore limit at runtime. <a href="#a163f5fa658c22a8581f802f48ec76dc8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#a82518fcd87edc0f6610ac59cbd8c8dbc">wait</a> (<a class="el" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a> timeout)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Wait until the semphore usage count is less than the thread limit. <a href="#a82518fcd87edc0f6610ac59cbd8c8dbc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#a56ec938f1b92ac4395e63489e7b1103c">wait</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Wait until the semphore usage count is less than the thread limit. <a href="#a56ec938f1b92ac4395e63489e7b1103c"></a><br/></td></tr>
<tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#acce63e350f70c4daaf374d02f279cbfd">release</a> (<a class="el" href="a00132.html">semaphore</a> &sync)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convenience class to release a semaphore. <a href="#acce63e350f70c4daaf374d02f279cbfd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#a0d1a2804e69093632ff027a55b4d1b55">wait</a> (<a class="el" href="a00132.html">semaphore</a> &sync, <a class="el" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a> timeout)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convenience class to wait on a semaphore. <a href="#a0d1a2804e69093632ff027a55b4d1b55"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00132.html#a72969f497a03901596d08b31ca1fe2d0">wait</a> (<a class="el" href="a00132.html">semaphore</a> &sync)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convenience class to wait on a semaphore. <a href="#a72969f497a03901596d08b31ca1fe2d0"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>A portable counting semaphore class. </p>
<p>A semaphore will allow threads to pass through it until the count is reached, and blocks further threads. Unlike pthread semaphore, our semaphore class supports it's count limit to be altered during runtime and the use of timed waits. This class also implements the <a class="el" href="a00137.html" title="A kind of smart pointer object to support shared locking protocol.">shared_lock</a> protocol. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>David Sugar <<a href="mailto:dyfet@gnutelephony.org">dyfet@gnutelephony.org</a>> </dd></dl>
<p>Definition at line <a class="el" href="a00208_source.html#l00991">991</a> of file <a class="el" href="a00208_source.html">thread.h</a>.</p>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a74da3bd63a2c8393912a95fc9a5fe12a"></a><!-- doxytag: member="ucc::semaphore::getCount" ref="a74da3bd63a2c8393912a95fc9a5fe12a" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned ucc::semaphore::getCount </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Get active semaphore limit. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>count of maximum threads to pass. </dd></dl>
</div>
</div>
<a class="anchor" id="a77b6c287d5ec5f6fcde9bf10616a17b0"></a><!-- doxytag: member="ucc::semaphore::getUsed" ref="a77b6c287d5ec5f6fcde9bf10616a17b0" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned ucc::semaphore::getUsed </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Get current semaphore usage. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>number of active threads. </dd></dl>
</div>
</div>
<a class="anchor" id="acce63e350f70c4daaf374d02f279cbfd"></a><!-- doxytag: member="ucc::semaphore::release" ref="acce63e350f70c4daaf374d02f279cbfd" args="(semaphore &sync)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static void ucc::semaphore::release </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00132.html">semaphore</a> & </td>
<td class="paramname"> <em>sync</em></td>
<td> ) </td>
<td><code> [inline, static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Convenience class to release a semaphore. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sync</em> </td><td>object to release. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="a00208_source.html#l01075">1075</a> of file <a class="el" href="a00208_source.html">thread.h</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="a00132_acce63e350f70c4daaf374d02f279cbfd_cgraph.png" border="0" usemap="#a00132_acce63e350f70c4daaf374d02f279cbfd_cgraph_map" alt=""></div>
<map name="a00132_acce63e350f70c4daaf374d02f279cbfd_cgraph_map" id="a00132_acce63e350f70c4daaf374d02f279cbfd_cgraph">
<area shape="rect" id="node3" href="a00132.html#a884c8c2b1a5cf2df607cffb668b447fb" title="Release the semaphore after waiting for it." alt="" coords="236,5,415,35"/></map>
</div>
</p>
</div>
</div>
<a class="anchor" id="a163f5fa658c22a8581f802f48ec76dc8"></a><!-- doxytag: member="ucc::semaphore::set" ref="a163f5fa658c22a8581f802f48ec76dc8" args="(unsigned count)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ucc::semaphore::set </td>
<td>(</td>
<td class="paramtype">unsigned </td>
<td class="paramname"> <em>count</em></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Alter semaphore limit at runtime. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>count</em> </td><td>of threads to allow. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a0d1a2804e69093632ff027a55b4d1b55"></a><!-- doxytag: member="ucc::semaphore::wait" ref="a0d1a2804e69093632ff027a55b4d1b55" args="(semaphore &sync, timeout_t timeout)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static bool ucc::semaphore::wait </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00132.html">semaphore</a> & </td>
<td class="paramname"> <em>sync</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a> </td>
<td class="paramname"> <em>timeout</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline, static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Convenience class to wait on a semaphore. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sync</em> </td><td>object to wait on. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>timeout</em> </td><td>in milliseconds. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>if success, false if timeout. </dd></dl>
<p>Definition at line <a class="el" href="a00208_source.html#l01068">1068</a> of file <a class="el" href="a00208_source.html">thread.h</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="a00132_a0d1a2804e69093632ff027a55b4d1b55_cgraph.png" border="0" usemap="#a00132_a0d1a2804e69093632ff027a55b4d1b55_cgraph_map" alt=""></div>
<map name="a00132_a0d1a2804e69093632ff027a55b4d1b55_cgraph_map" id="a00132_a0d1a2804e69093632ff027a55b4d1b55_cgraph">
<area shape="rect" id="node3" href="a00132.html#a56ec938f1b92ac4395e63489e7b1103c" title="Wait until the semphore usage count is less than the thread limit." alt="" coords="215,5,372,35"/></map>
</div>
</p>
</div>
</div>
<a class="anchor" id="a72969f497a03901596d08b31ca1fe2d0"></a><!-- doxytag: member="ucc::semaphore::wait" ref="a72969f497a03901596d08b31ca1fe2d0" args="(semaphore &sync)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static void ucc::semaphore::wait </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00132.html">semaphore</a> & </td>
<td class="paramname"> <em>sync</em></td>
<td> ) </td>
<td><code> [inline, static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Convenience class to wait on a semaphore. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sync</em> </td><td>object to wait on. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="a00208_source.html#l01059">1059</a> of file <a class="el" href="a00208_source.html">thread.h</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="a00132_a72969f497a03901596d08b31ca1fe2d0_cgraph.png" border="0" usemap="#a00132_a72969f497a03901596d08b31ca1fe2d0_cgraph_map" alt=""></div>
<map name="a00132_a72969f497a03901596d08b31ca1fe2d0_cgraph_map" id="a00132_a72969f497a03901596d08b31ca1fe2d0_cgraph">
<area shape="rect" id="node3" href="a00132.html#a56ec938f1b92ac4395e63489e7b1103c" title="Wait until the semphore usage count is less than the thread limit." alt="" coords="215,5,372,35"/></map>
</div>
</p>
</div>
</div>
<a class="anchor" id="a82518fcd87edc0f6610ac59cbd8c8dbc"></a><!-- doxytag: member="ucc::semaphore::wait" ref="a82518fcd87edc0f6610ac59cbd8c8dbc" args="(timeout_t timeout)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool ucc::semaphore::wait </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a> </td>
<td class="paramname"> <em>timeout</em></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wait until the semphore usage count is less than the thread limit. </p>
<p>Increase used count for our thread when unblocked, or return without changing if timed out. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>timeout</em> </td><td>to wait in millseconds. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if success, false if timeout. </dd></dl>
<p>Reimplemented from <a class="el" href="a00040.html#a3f860e115dfe20ff91c89eaa0db4115d">ucc::Conditional</a>.</p>
</div>
</div>
<a class="anchor" id="a56ec938f1b92ac4395e63489e7b1103c"></a><!-- doxytag: member="ucc::semaphore::wait" ref="a56ec938f1b92ac4395e63489e7b1103c" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ucc::semaphore::wait </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wait until the semphore usage count is less than the thread limit. </p>
<p>Increase used count for our thread when unblocked. </p>
<p>Reimplemented from <a class="el" href="a00040.html#a6e3df297dbc742f3180bfe8862d166a3">ucc::Conditional</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>ucommon/<a class="el" href="a00208_source.html">thread.h</a></li>
</ul>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 6 08:22:44 2010 for UCommon by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>
|