Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > d4089b27bfd3289c6baf8b0975a53f9e > files > 649

poco-doc-1.3.6p1-1.fc13.i686.rpm

<!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>
<title>Class Poco::Thread</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.html" class="namespace">Poco</a></h1>
<h1 class="symbol">class Thread</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Foundation<br />
<b>Package:</b> Threading<br />
<b>Header:</b> Poco/Thread.h</p>
<h2>Description</h2>
<div class="description">
<p>This class implements a platform-independent wrapper to an operating system thread. </p>
<p>Every <a href="Poco.Thread.html" title="class Poco::Thread">Thread</a> object gets a unique (within its process) numeric thread ID. Furthermore, a thread can be assigned a name. The name of a thread can be changed at any time. </p>
</div>
<h2>Inheritance</h2>
<p><b>Direct Base Classes: </b>ThreadImpl</p>
<p><b>All Base Classes: </b>ThreadImpl</p>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.Thread.html#10859" title="Poco::Thread::clearTLS()">clearTLS</a>, <a href="Poco.Thread.html#10856" title="Poco::Thread::current()">current</a>, <a href="Poco.Thread.html#10857" title="Poco::Thread::currentTid()">currentTid</a>, <a href="Poco.Thread.html#10838" title="Poco::Thread::getMaxOSPriority()">getMaxOSPriority</a>, <a href="Poco.Thread.html#10837" title="Poco::Thread::getMinOSPriority()">getMinOSPriority</a>, <a href="Poco.Thread.html#10828" title="Poco::Thread::getName()">getName</a>, <a href="Poco.Thread.html#10836" title="Poco::Thread::getOSPriority()">getOSPriority</a>, <a href="Poco.Thread.html#10833" title="Poco::Thread::getPriority()">getPriority</a>, <a href="Poco.Thread.html#10841" title="Poco::Thread::getStackSize()">getStackSize</a>, <a href="Poco.Thread.html#10825" title="Poco::Thread::id()">id</a>, <a href="Poco.Thread.html#10852" title="Poco::Thread::isRunning()">isRunning</a>, <a href="Poco.Thread.html#10847" title="Poco::Thread::join()">join</a>, <a href="Poco.Thread.html#10860" title="Poco::Thread::makeName()">makeName</a>, <a href="Poco.Thread.html#10827" title="Poco::Thread::name()">name</a>, <a href="Poco.Thread.html#10829" title="Poco::Thread::setName()">setName</a>, <a href="Poco.Thread.html#10834" title="Poco::Thread::setOSPriority()">setOSPriority</a>, <a href="Poco.Thread.html#10831" title="Poco::Thread::setPriority()">setPriority</a>, <a href="Poco.Thread.html#10839" title="Poco::Thread::setStackSize()">setStackSize</a>, <a href="Poco.Thread.html#10853" title="Poco::Thread::sleep()">sleep</a>, <a href="Poco.Thread.html#10842" title="Poco::Thread::start()">start</a>, <a href="Poco.Thread.html#10826" title="Poco::Thread::tid()">tid</a>, <a href="Poco.Thread.html#10858" title="Poco::Thread::tls()">tls</a>, <a href="Poco.Thread.html#10850" title="Poco::Thread::tryJoin()">tryJoin</a>, <a href="Poco.Thread.html#10861" title="Poco::Thread::uniqueId()">uniqueId</a>, <a href="Poco.Thread.html#10855" title="Poco::Thread::yield()">yield</a></p>
<h2>Types</h2>
<h3><a name="10813">TID</a></h3>
<p class="decl">typedef ThreadImpl::TIDImpl <a href="Poco.Thread.html#10813" title="Poco::Thread::TID">TID</a>;</p>
<div class="description">
<p></p>
</div>
<h2>Enumerations</h2>
<h3><a name="10815">Priority</a></h3>
<div class="description">
<p><a href="Poco.Thread.html" title="class Poco::Thread">Thread</a> priorities. </p>
</div>
<p class="decl"><a name="10816">PRIO_LOWEST</a> = PRIO_LOWEST_IMPL</p>
<div class="description">
<p>The lowest thread priority. </p>
</div>
<p class="decl"><a name="10817">PRIO_LOW</a> = PRIO_LOW_IMPL</p>
<div class="description">
<p>A lower than normal thread priority. </p>
</div>
<p class="decl"><a name="10818">PRIO_NORMAL</a> = PRIO_NORMAL_IMPL</p>
<div class="description">
<p>The normal thread priority. </p>
</div>
<p class="decl"><a name="10819">PRIO_HIGH</a> = PRIO_HIGH_IMPL</p>
<div class="description">
<p>A higher than normal thread priority. </p>
</div>
<p class="decl"><a name="10820">PRIO_HIGHEST</a> = PRIO_HIGHEST_IMPL</p>
<div class="description">
<p>The highest thread priority. </p>
</div>
<h2>Constructors</h2>
<h3><a name="10821">Thread</a></h3>
<p class="decl"><a href="Poco.Thread.html" title="class Poco::Thread">Thread</a>();</p>
<div class="description">
<p>Creates a thread. Call <a href="Poco.Thread.html#10842" title="Poco::Thread::start()">start</a>() to start it. </p>
</div>
<h3><a name="10822">Thread</a></h3>
<p class="decl"><a href="Poco.Thread.html" title="class Poco::Thread">Thread</a>(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; name<br />);</p>
<div class="description">
<p>Creates a named thread. Call <a href="Poco.Thread.html#10842" title="Poco::Thread::start()">start</a>() to start it. </p>
</div>
<h2>Destructor</h2>
<h3><a name="10824">~Thread</a></h3>
<p class="decl">~<a href="Poco.Thread.html" title="class Poco::Thread">Thread</a>();</p>
<div class="description">
<p>Destroys the thread. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="10856">current</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static <a href="Poco.Thread.html" title="class Poco::Thread">Thread</a> * current();</p>
<div class="description">
<p>Returns the <a href="Poco.Thread.html" title="class Poco::Thread">Thread</a> object for the currently active thread. If the current thread is the main thread, 0 is returned. </p>
</div>
<h3><a name="10857">currentTid</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static <a href="Poco.Thread.html#10813" title="Poco::Thread::TID">TID</a> currentTid();</p>
<div class="description">
<p>Returns the native thread ID for the current thread.     </p>
</div>
<h3><a name="10838">getMaxOSPriority</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static int getMaxOSPriority();</p>
<div class="description">
<p>Returns the maximum operating system-specific priority value, which can be passed to <a href="Poco.Thread.html#10834" title="Poco::Thread::setOSPriority()">setOSPriority</a>(). </p>
</div>
<h3><a name="10837">getMinOSPriority</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static int getMinOSPriority();</p>
<div class="description">
<p>Returns the mininum operating system-specific priority value, which can be passed to <a href="Poco.Thread.html#10834" title="Poco::Thread::setOSPriority()">setOSPriority</a>(). </p>
</div>
<h3><a name="10828">getName</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">std::string getName() const;</p>
<div class="description">
<p>Returns teh name of the thread. </p>
</div>
<h3><a name="10836">getOSPriority</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">int getOSPriority() const;</p>
<div class="description">
<p>Returns the thread's priority, expressed as an operating system specific priority value. </p>
</div>
<h3><a name="10833">getPriority</a></h3>
<p class="decl"><a href="Poco.Thread.html#10815" title="enum  Poco::Thread::Priority">Priority</a> getPriority() const;</p>
<div class="description">
<p>Returns the thread's priority. </p>
</div>
<h3><a name="10841">getStackSize</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">int getStackSize() const;</p>
<div class="description">
<p>Returns the thread's stack size in bytes. If the default stack size is used, 0 is returned. </p>
</div>
<h3><a name="10825">id</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">int id() const;</p>
<div class="description">
<p>Returns the unique thread ID of the thread. </p>
</div>
<h3><a name="10852">isRunning</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool isRunning() const;</p>
<div class="description">
<p>Returns true if the thread is running. </p>
</div>
<h3><a name="10847">join</a></h3>
<p class="decl">void join();</p>
<div class="description">
<p>Waits until the thread completes execution.	 If multiple threads try to join the same thread, the result is undefined. </p>
</div>
<h3><a name="10848">join</a></h3>
<p class="decl">void join(<br />&nbsp;&nbsp;&nbsp;&nbsp;long milliseconds<br />);</p>
<div class="description">
<p>Waits for at most the given interval for the thread to complete. Throws a <a href="Poco.TimeoutException.html" title="class Poco::TimeoutException">TimeoutException</a> if the thread does not complete within the specified time interval. </p>
</div>
<h3><a name="10827">name</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">std::string name() const;</p>
<div class="description">
<p>Returns the name of the thread. </p>
</div>
<h3><a name="10829">setName</a></h3>
<p class="decl">void setName(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; name<br />);</p>
<div class="description">
<p>Sets the name of the thread. </p>
</div>
<h3><a name="10834">setOSPriority</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void setOSPriority(<br />&nbsp;&nbsp;&nbsp;&nbsp;int prio<br />);</p>
<div class="description">
<p>Sets the thread's priority, using an operating system specific priority value. Use <a href="Poco.Thread.html#10837" title="Poco::Thread::getMinOSPriority()">getMinOSPriority</a>() and <a href="Poco.Thread.html#10838" title="Poco::Thread::getMaxOSPriority()">getMaxOSPriority</a>() to obtain mininum and maximum priority values. </p>
</div>
<h3><a name="10831">setPriority</a></h3>
<p class="decl">void setPriority(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Thread.html#10815" title="enum  Poco::Thread::Priority">Priority</a> prio<br />);</p>
<div class="description">
<p>Sets the thread's priority. </p>
<p>Some platform only allow changing a thread's priority if the process has certain privileges. </p>
</div>
<h3><a name="10839">setStackSize</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void setStackSize(<br />&nbsp;&nbsp;&nbsp;&nbsp;int size<br />);</p>
<div class="description">
<p>Sets the thread's stack size in bytes. Setting the stack size to 0 will use the default stack size. Typically, the real stack size is rounded up to the nearest page size multiple. </p>
</div>
<h3><a name="10853">sleep</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static void sleep(<br />&nbsp;&nbsp;&nbsp;&nbsp;long milliseconds<br />);</p>
<div class="description">
<p>Suspends the current thread for the specified amount of time. </p>
</div>
<h3><a name="10842">start</a></h3>
<p class="decl">void start(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Runnable.html" title="class Poco::Runnable">Runnable</a> &amp; target<br />);</p>
<div class="description">
<p>Starts the thread with the given target. </p>
</div>
<h3><a name="10844">start</a></h3>
<p class="decl">void start(<br />&nbsp;&nbsp;&nbsp;&nbsp;Callable target,<br />&nbsp;&nbsp;&nbsp;&nbsp;void * pData = 0<br />);</p>
<div class="description">
<p>Starts the thread with the given target and parameter. </p>
</div>
<h3><a name="10826">tid</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Thread.html#10813" title="Poco::Thread::TID">TID</a> tid() const;</p>
<div class="description">
<p>Returns the native thread ID of the thread. </p>
</div>
<h3><a name="10850">tryJoin</a></h3>
<p class="decl">bool tryJoin(<br />&nbsp;&nbsp;&nbsp;&nbsp;long milliseconds<br />);</p>
<div class="description">
<p>Waits for at most the given interval for the thread to complete. Returns true if the thread has finished, false otherwise. </p>
</div>
<h3><a name="10855">yield</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static void yield();</p>
<div class="description">
<p>Yields cpu to other threads. </p>
</div>
<h3><a name="10859">clearTLS</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void clearTLS();</p>
<div class="description">
<p>Clears the thread's local storage. </p>
</div>
<h3><a name="10860">makeName</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">std::string makeName();</p>
<div class="description">
<p>Creates a unique name for a thread. </p>
</div>
<h3><a name="10858">tls</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.ThreadLocalStorage.html" title="class Poco::ThreadLocalStorage">ThreadLocalStorage</a> &amp; tls();</p>
<div class="description">
<p>Returns a reference to the thread's local storage. </p>
</div>
<h3><a name="10861">uniqueId</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static int uniqueId();</p>
<div class="description">
<p>Creates and returns a unique id for a thread. </p>
</div>
<h2>Variables</h2>
<h3><a name="10814">ThreadImpl::Callable</a></h3>
<p class="decl">using ThreadImpl::Callable;</p>
<div class="description">
<p></p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright &copy; 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>

</div>
</body>
</html>