mirror of
https://github.com/etlegacy/Update-Installer.git
synced 2024-11-26 13:51:11 +00:00
5360d05867
This saves the need to install Boost::Thread on each of the build systems.
214 lines
12 KiB
HTML
214 lines
12 KiB
HTML
<!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>TinyThread++: 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="index.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>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="annotated.html"><span>Class List</span></a></li>
|
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="navpath"><a class="el" href="namespacetthread.html">tthread</a>::<a class="el" href="classtthread_1_1thread.html">thread</a>
|
|
</div>
|
|
</div>
|
|
<div class="contents">
|
|
<h1>thread Class Reference</h1><!-- doxytag: class="tthread::thread" -->
|
|
<p>Thread class.
|
|
<a href="#_details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="tinythread_8h_source.html">tinythread.h</a>></code></p>
|
|
|
|
<p><a href="classtthread_1_1thread-members.html">List of all members.</a></p>
|
|
<table border="0" cellpadding="0" cellspacing="0">
|
|
<tr><td colspan="2"><h2>Classes</h2></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classtthread_1_1thread_1_1id.html">id</a></td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Thread ID. <a href="classtthread_1_1thread_1_1id.html#_details">More...</a><br/></td></tr>
|
|
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classtthread_1_1thread.html#a1816c2a63c2941090f9a24e5a62efea1">thread</a> ()</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="#a1816c2a63c2941090f9a24e5a62efea1"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classtthread_1_1thread.html#ad8d7d1e1d70de55c08472077b2e1a953">thread</a> (void(*aFunction)(void *), void *aArg)</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Thread starting constructor. <a href="#ad8d7d1e1d70de55c08472077b2e1a953"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classtthread_1_1thread.html#a626c04c85c7e2b10215bc4a35062f177">~thread</a> ()</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#a626c04c85c7e2b10215bc4a35062f177"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6c7abfff648dad193674fc432ad4840d"></a><!-- doxytag: member="tthread::thread::join" ref="a6c7abfff648dad193674fc432ad4840d" args="()" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classtthread_1_1thread.html#a6c7abfff648dad193674fc432ad4840d">join</a> ()</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Wait for the thread to finish (join execution flows). <br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classtthread_1_1thread.html#a5f02386ef3b6ef614321b6ec3606b242">joinable</a> () const </td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Check if the thread is joinable. <a href="#a5f02386ef3b6ef614321b6ec3606b242"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afb4f4110b330d27774c16baec4f7d4f5"></a><!-- doxytag: member="tthread::thread::get_id" ref="afb4f4110b330d27774c16baec4f7d4f5" args="() const " -->
|
|
<a class="el" href="classtthread_1_1thread_1_1id.html">id</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classtthread_1_1thread.html#afb4f4110b330d27774c16baec4f7d4f5">get_id</a> () const </td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the thread ID of a thread object. <br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">native_handle_type </td><td class="memItemRight" valign="bottom"><a class="el" href="classtthread_1_1thread.html#ac9ba019ced75a29c52c41aff4e1ca20e">native_handle</a> ()</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the native handle for this thread. <a href="#ac9ba019ced75a29c52c41aff4e1ca20e"></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 unsigned </td><td class="memItemRight" valign="bottom"><a class="el" href="classtthread_1_1thread.html#a3b04fb20012111681e37dfe63f105f6d">hardware_concurrency</a> ()</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Determine the number of threads which can possibly execute concurrently. <a href="#a3b04fb20012111681e37dfe63f105f6d"></a><br/></td></tr>
|
|
</table>
|
|
<hr/><a name="_details"></a><h2>Detailed Description</h2>
|
|
<p>Thread class. </p>
|
|
<hr/><h2>Constructor & Destructor Documentation</h2>
|
|
<a class="anchor" id="a1816c2a63c2941090f9a24e5a62efea1"></a><!-- doxytag: member="tthread::thread::thread" ref="a1816c2a63c2941090f9a24e5a62efea1" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classtthread_1_1thread.html">thread</a> </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td>
|
|
<td> ) </td>
|
|
<td><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Default constructor. </p>
|
|
<p>Construct a <code>thread</code> object without an associated thread of execution (i.e. non-joinable). </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ad8d7d1e1d70de55c08472077b2e1a953"></a><!-- doxytag: member="tthread::thread::thread" ref="ad8d7d1e1d70de55c08472077b2e1a953" args="(void(*aFunction)(void *), void *aArg)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classtthread_1_1thread.html">thread</a> </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void(*)(void *) </td>
|
|
<td class="paramname"> <em>aFunction</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">void * </td>
|
|
<td class="paramname"> <em>aArg</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Thread starting constructor. </p>
|
|
<p>Construct a <code>thread</code> object with a new thread of execution. </p>
|
|
<dl><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>aFunction</em> </td><td>A function pointer to a function of type: <code>void fun(void * arg)</code> </td></tr>
|
|
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>aArg</em> </td><td>Argument to the thread function. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="note"><dt><b>Note:</b></dt><dd>This constructor is not fully compatible with the standard C++ thread class. It is more similar to the pthread_create() (POSIX) and CreateThread() (Windows) functions. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a626c04c85c7e2b10215bc4a35062f177"></a><!-- doxytag: member="tthread::thread::~thread" ref="a626c04c85c7e2b10215bc4a35062f177" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">~<a class="el" href="classtthread_1_1thread.html">thread</a> </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Destructor. </p>
|
|
<dl class="note"><dt><b>Note:</b></dt><dd>If the thread is joinable upon destruction, <code>std::terminate()</code> will be called, which terminates the process. It is always wise to do <code><a class="el" href="classtthread_1_1thread.html#a6c7abfff648dad193674fc432ad4840d" title="Wait for the thread to finish (join execution flows).">join()</a></code> before deleting a thread object. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/><h2>Member Function Documentation</h2>
|
|
<a class="anchor" id="a3b04fb20012111681e37dfe63f105f6d"></a><!-- doxytag: member="tthread::thread::hardware_concurrency" ref="a3b04fb20012111681e37dfe63f105f6d" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static unsigned hardware_concurrency </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td>
|
|
<td> ) </td>
|
|
<td><code> [static]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Determine the number of threads which can possibly execute concurrently. </p>
|
|
<p>This function is useful for determining the optimal number of threads to use for a task. </p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of hardware thread contexts in the system. </dd></dl>
|
|
<dl class="note"><dt><b>Note:</b></dt><dd>If this value is not defined, the function returns zero (0). </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a5f02386ef3b6ef614321b6ec3606b242"></a><!-- doxytag: member="tthread::thread::joinable" ref="a5f02386ef3b6ef614321b6ec3606b242" args="() const " -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool joinable </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td>
|
|
<td> ) </td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Check if the thread is joinable. </p>
|
|
<p>A thread object is joinable if it has an associated thread of execution. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ac9ba019ced75a29c52c41aff4e1ca20e"></a><!-- doxytag: member="tthread::thread::native_handle" ref="ac9ba019ced75a29c52c41aff4e1ca20e" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">native_handle_type native_handle </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td>
|
|
<td> ) </td>
|
|
<td><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Get the native handle for this thread. </p>
|
|
<dl class="note"><dt><b>Note:</b></dt><dd>Under Windows, this is a <code>HANDLE</code>, and under POSIX systems, this is a <code>pthread_t</code>. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
|
<li><a class="el" href="tinythread_8h_source.html">tinythread.h</a></li>
|
|
</ul>
|
|
</div>
|
|
<hr class="footer"/><address style="text-align: right;"><small>Generated on Fri Oct 1 21:49:34 2010 for TinyThread++ 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>
|