/usr/share/doc/libucommon-dev/a00166.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 | <!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::Thread 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="a00166.html">Thread</a>
</div>
</div>
<div class="contents">
<h1>ucc::Thread Class Reference</h1><!-- doxytag: class="ucc::Thread" -->
<p>An abstract class for defining classes that operate as a thread.
<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::Thread:</div>
<div class="dynsection">
<div class="center"><img src="a00569.png" border="0" usemap="#ucc_1_1_thread_inherit__map" alt="Inheritance graph"/></div>
<map name="ucc_1_1_thread_inherit__map" id="ucc_1_1_thread_inherit__map">
<area shape="rect" id="node3" href="a00049.html" title="A detached thread object that is stand-alone." alt="" coords="5,83,163,112"/><area shape="rect" id="node5" href="a00058.html" title="A child thread object that may be joined by parent." alt="" coords="187,83,331,112"/></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">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00166.html#a543d27d6cfe3a67f690b3769b5f5883d">exit</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Exit the thread context. <a href="#a543d27d6cfe3a67f690b3769b5f5883d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af2141c3768106bd6335bddafdb240f8f"></a><!-- doxytag: member="ucc::Thread::run" ref="af2141c3768106bd6335bddafdb240f8f" args="(void)=0" -->
virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00166.html#af2141c3768106bd6335bddafdb240f8f">run</a> (void)=0</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Abstract interface for thread context run method. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00166.html#a0214868c389d687c8f11795d05ab1ab1">setPriority</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set thread priority without disrupting scheduling if possible. <a href="#a0214868c389d687c8f11795d05ab1ab1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6a962dcef56900facd01b1f1179ea39d"></a><!-- doxytag: member="ucc::Thread::~Thread" ref="a6a962dcef56900facd01b1f1179ea39d" args="()" -->
virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="a00166.html#a6a962dcef56900facd01b1f1179ea39d">~Thread</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destroy thread object, thread-specific data, and execution context. <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="a00166.html#a44199491262ca9b93b7945c6d4711b12">concurrency</a> (int level)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set concurrency level of process. <a href="#a44199491262ca9b93b7945c6d4711b12"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00166.html#af995c8bb997718cd0573c1e216aff212">equal</a> (pthread_t thread1, pthread_t thread2)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Determine if two thread identifiers refer to the same thread. <a href="#af995c8bb997718cd0573c1e216aff212"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00166.html#a67ddf171f7cbc051dfc83b91c5f80b82">init</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Used to initialize threading library. <a href="#a67ddf171f7cbc051dfc83b91c5f80b82"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00166.html#a6eeea6f66881e763cdd8b75444e34ec8">policy</a> (int polid)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Used to specify scheduling policy for threads above priority "0". <a href="#a6eeea6f66881e763cdd8b75444e34ec8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static pthread_t </td><td class="memItemRight" valign="bottom"><a class="el" href="a00166.html#a1991d3af92a7dba4c513acfc4e363424">self</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get current thread id. <a href="#a1991d3af92a7dba4c513acfc4e363424"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00166.html#a2bff536a5cb0cea408ab5ef67e0a92dd">sleep</a> (<a class="el" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a> timeout)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Sleep current thread for a specified time period. <a href="#a2bff536a5cb0cea408ab5ef67e0a92dd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00166.html#a1c30136f7d3670800849c8e72987ae09">yield</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Yield execution context of the current thread. <a href="#a1c30136f7d3670800849c8e72987ae09"></a><br/></td></tr>
<tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00166.html#a8a136a571580c65f2ce22357a21c85c1">Thread</a> (size_t <a class="el" href="a00155.html">stack</a>=0)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a thread object that will have a preset stack size. <a href="#a8a136a571580c65f2ce22357a21c85c1"></a><br/></td></tr>
<tr><td colspan="2"><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3df18628861415e1eee91782dba4f5eb"></a><!-- doxytag: member="ucc::Thread::priority" ref="a3df18628861415e1eee91782dba4f5eb" args="" -->
int </td><td class="memItemRight" valign="bottom"><b>priority</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a76e5b0db7e1f153407e03907afc24748"></a><!-- doxytag: member="ucc::Thread::stack" ref="a76e5b0db7e1f153407e03907afc24748" args="" -->
size_t </td><td class="memItemRight" valign="bottom"><b>stack</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa907bc7359e977b3fd8fc2478cbea8f0"></a><!-- doxytag: member="ucc::Thread::tid" ref="aa907bc7359e977b3fd8fc2478cbea8f0" args="" -->
pthread_t </td><td class="memItemRight" valign="bottom"><b>tid</b></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>An abstract class for defining classes that operate as a thread. </p>
<p>A derived thread class has a run method that is invoked with the newly created thread context, and can use the derived object to store all member data that needs to be associated with that context. This means the derived object can safely hold thread-specific data that is managed with the life of the object, rather than having to use the clumsy thread-specific data management and access functions found in thread support libraries. </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#l01453">1453</a> of file <a class="el" href="a00208_source.html">thread.h</a>.</p>
<hr/><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" id="a8a136a571580c65f2ce22357a21c85c1"></a><!-- doxytag: member="ucc::Thread::Thread" ref="a8a136a571580c65f2ce22357a21c85c1" args="(size_t stack=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ucc::Thread::Thread </td>
<td>(</td>
<td class="paramtype">size_t </td>
<td class="paramname"> <em>stack</em> = <code>0</code></td>
<td> ) </td>
<td><code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Create a thread object that will have a preset stack size. </p>
<p>If 0 is used, then the stack size is os defined/default. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>stack</em> </td><td>size to use or 0 for default. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a44199491262ca9b93b7945c6d4711b12"></a><!-- doxytag: member="ucc::Thread::concurrency" ref="a44199491262ca9b93b7945c6d4711b12" args="(int level)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static void ucc::Thread::concurrency </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"> <em>level</em></td>
<td> ) </td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Set concurrency level of process. </p>
<p>This is essentially a portable wrapper for pthread_setconcurrency. </p>
</div>
</div>
<a class="anchor" id="af995c8bb997718cd0573c1e216aff212"></a><!-- doxytag: member="ucc::Thread::equal" ref="af995c8bb997718cd0573c1e216aff212" args="(pthread_t thread1, pthread_t thread2)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static bool ucc::Thread::equal </td>
<td>(</td>
<td class="paramtype">pthread_t </td>
<td class="paramname"> <em>thread1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">pthread_t </td>
<td class="paramname"> <em>thread2</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Determine if two thread identifiers refer to the same thread. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>thread1</em> </td><td>to test. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>thread2</em> </td><td>to test. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if both are the same context. </dd></dl>
</div>
</div>
<a class="anchor" id="a543d27d6cfe3a67f690b3769b5f5883d"></a><!-- doxytag: member="ucc::Thread::exit" ref="a543d27d6cfe3a67f690b3769b5f5883d" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void ucc::Thread::exit </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Exit the thread context. </p>
<p>This function should NO LONGER be called directly to exit a running thread. Instead this method will only be used to modify the behavior of the thread context at thread exit, including detached threads which by default delete themselves. This documented usage was changed to support Mozilla NSPR exit behavior in case we support NSPR as an alternate thread runtime in the future. </p>
<p>Reimplemented in <a class="el" href="a00049.html#ae3d67e92625d42ed3f68aabd7d7a2f40">ucc::DetachedThread</a>.</p>
</div>
</div>
<a class="anchor" id="a67ddf171f7cbc051dfc83b91c5f80b82"></a><!-- doxytag: member="ucc::Thread::init" ref="a67ddf171f7cbc051dfc83b91c5f80b82" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static void ucc::Thread::init </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Used to initialize threading library. </p>
<p>May be needed for some platforms. </p>
</div>
</div>
<a class="anchor" id="a6eeea6f66881e763cdd8b75444e34ec8"></a><!-- doxytag: member="ucc::Thread::policy" ref="a6eeea6f66881e763cdd8b75444e34ec8" args="(int polid)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static void ucc::Thread::policy </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"> <em>polid</em></td>
<td> ) </td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Used to specify scheduling policy for threads above priority "0". </p>
<p>Normally we apply static realtime policy SCHED_FIFO (default) or SCHED_RR. However, we could apply SCHED_OTHER, etc. </p>
</div>
</div>
<a class="anchor" id="a1991d3af92a7dba4c513acfc4e363424"></a><!-- doxytag: member="ucc::Thread::self" ref="a1991d3af92a7dba4c513acfc4e363424" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static pthread_t ucc::Thread::self </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [inline, static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Get current thread id. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>thread id. </dd></dl>
<p>Definition at line <a class="el" href="a00208_source.html#l01542">1542</a> of file <a class="el" href="a00208_source.html">thread.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0214868c389d687c8f11795d05ab1ab1"></a><!-- doxytag: member="ucc::Thread::setPriority" ref="a0214868c389d687c8f11795d05ab1ab1" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ucc::Thread::setPriority </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Set thread priority without disrupting scheduling if possible. </p>
<p>Based on scheduling policy. It is recommended that the process is set for realtime scheduling, and this method is actually for internal use. </p>
</div>
</div>
<a class="anchor" id="a2bff536a5cb0cea408ab5ef67e0a92dd"></a><!-- doxytag: member="ucc::Thread::sleep" ref="a2bff536a5cb0cea408ab5ef67e0a92dd" args="(timeout_t timeout)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static void ucc::Thread::sleep </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><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sleep current thread for a specified time period. </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 sleep for in milliseconds. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a1c30136f7d3670800849c8e72987ae09"></a><!-- doxytag: member="ucc::Thread::yield" ref="a1c30136f7d3670800849c8e72987ae09" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static void ucc::Thread::yield </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Yield execution context of the current thread. </p>
<p>This is a static and may be used anywhere. </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:51 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>
|