Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > bad97183153701b09df5fae1052b1c30 > files > 384

crystalspace-doc-1.2.1-5mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Crystal Space 1.2.1: csCondition Class Reference (Crystal Space 1.2.1 Public API Reference)</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="head">
 <tr height="59">
  <td class="head" width="202" valign="bottom" style="padding-left:0;"><a href="http://www.crystalspace3d.org/"><img src="csblur.png" width="236" height="59" alt="CrystalSpace" border="0"></a></td>
  <td class="head"><h2>Public API Reference</h2></td>
 </tr>
 <tr height="11">
  <td colspan="2" class="headshadow" valign="top" style="padding-left:0;"><img src="csblurb.png" width="236" height="11" alt="" border="0"></td>
 </tr>
</table>
<div class="content">
<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li class="current"><a href="classes.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<div class="tabs">
  <ul>
    <li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul>
</div>
<h1>csCondition Class Reference</h1><!-- doxytag: class="csCondition" --><!-- doxytag: inherits="csRefCount" -->A condition object.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="thread_8h-source.html">csutil/thread.h</a>&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for csCondition:</div>
<div class="dynsection">
<p><center><img src="classcsCondition__inherit__graph.png" border="0" usemap="#csCondition__inherit__map" alt="Inheritance graph"></center>
<map name="csCondition__inherit__map">
<area shape="rect" href="classcsRefCount.html" title="This is a class which provides basic reference&#45;counting semantics." alt="" coords="5,7,101,33"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>

<p>
<a href="classcsCondition-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual char const *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsCondition.html#b82465b551ae7fac8c63474b3826f8bc">GetLastError</a> () const =0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the last error description, else null if there was none.  <a href="#b82465b551ae7fac8c63474b3826f8bc"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsCondition.html#36d2e191c6e5111d055c5d7bfa2285b1">Signal</a> (bool WakeAll=false)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wake up one or all threads waiting upon a change of condition.  <a href="#36d2e191c6e5111d055c5d7bfa2285b1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsCondition.html#2813394aecf8b91dbfa65499249fb88a">Wait</a> (<a class="el" href="classcsMutex.html">csMutex</a> *mutex, <a class="el" href="group__util.html#g28e82998c4c2d1197a1d412bba7da793">csTicks</a> timeout=0)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wait for some change of condition.  <a href="#2813394aecf8b91dbfa65499249fb88a"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classcsRef.html">csRef</a><br>
&lt; <a class="el" href="classcsCondition.html">csCondition</a> &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsCondition.html#79fdf1922e66028d28d75d532f61da16">Create</a> (<a class="el" href="group__util.html#g1134b580f8da4de94ca6b1de4d37975e">uint32</a> conditionAttributes=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a condition with specific attributes.  <a href="#79fdf1922e66028d28d75d532f61da16"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A condition object. 
<p>
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000077">Deprecated:</a></b></dt><dd><a class="el" href="classcsCondition.html" title="A condition object.">csCondition</a> is deprecated. Use new subsystem in <a class="el" href="namespaceCS_1_1Threading.html" title="Functions and classes for threading, locking and atomic operations.">CS::Threading</a> instead </dd></dl>

<p>Definition at line <a class="el" href="thread_8h-source.html#l00285">285</a> of file <a class="el" href="thread_8h-source.html">thread.h</a>.</p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="79fdf1922e66028d28d75d532f61da16"></a><!-- doxytag: member="csCondition::Create" ref="79fdf1922e66028d28d75d532f61da16" args="(uint32 conditionAttributes=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classcsRef.html">csRef</a>&lt;<a class="el" href="classcsCondition.html">csCondition</a>&gt; csCondition::Create           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__util.html#g1134b580f8da4de94ca6b1de4d37975e">uint32</a>&nbsp;</td>
          <td class="paramname"> <em>conditionAttributes</em> = <code>0</code>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Create a condition with specific attributes. 
<p>

</div>
</div><p>
<a class="anchor" name="b82465b551ae7fac8c63474b3826f8bc"></a><!-- doxytag: member="csCondition::GetLastError" ref="b82465b551ae7fac8c63474b3826f8bc" args="() const =0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual char const* csCondition::GetLastError           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return the last error description, else null if there was none. 
<p>

</div>
</div><p>
<a class="anchor" name="36d2e191c6e5111d055c5d7bfa2285b1"></a><!-- doxytag: member="csCondition::Signal" ref="36d2e191c6e5111d055c5d7bfa2285b1" args="(bool WakeAll=false)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void csCondition::Signal           </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>WakeAll</em> = <code>false</code>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Wake up one or all threads waiting upon a change of condition. 
<p>
If WakeAll is false, only one waiting thread will be awakened and given access to the associated mutex. If WakeAll is true, all threads waiting on the condition will be awakened and will vie for the associated mutex. Only one thread will win the mutex (thus gaining access to the condition); all other waiting threads will be re-suspended. 
</div>
</div><p>
<a class="anchor" name="2813394aecf8b91dbfa65499249fb88a"></a><!-- doxytag: member="csCondition::Wait" ref="2813394aecf8b91dbfa65499249fb88a" args="(csMutex *mutex, csTicks timeout=0)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool csCondition::Wait           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classcsMutex.html">csMutex</a> *&nbsp;</td>
          <td class="paramname"> <em>mutex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__util.html#g28e82998c4c2d1197a1d412bba7da793">csTicks</a>&nbsp;</td>
          <td class="paramname"> <em>timeout</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Wait for some change of condition. 
<p>
Suspends the calling thread until some other thread invokes <a class="el" href="classcsCondition.html#36d2e191c6e5111d055c5d7bfa2285b1" title="Wake up one or all threads waiting upon a change of condition.">Signal()</a> to notify a change of condition. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>mutex</em>&nbsp;</td><td>The mutex to associate with this condition. The caller must already hold a lock on the mutex before calling <a class="el" href="classcsCondition.html#2813394aecf8b91dbfa65499249fb88a" title="Wait for some change of condition.">Wait()</a>, and all threads waiting on the condition must be using the same mutex. The mutex must <b>not</b> be locked recursively within the same thread. When called, <a class="el" href="classcsCondition.html#2813394aecf8b91dbfa65499249fb88a" title="Wait for some change of condition.">Wait()</a> releases the caller's lock on the mutex and suspends the caller's thread. Upon return from <a class="el" href="classcsCondition.html#2813394aecf8b91dbfa65499249fb88a" title="Wait for some change of condition.">Wait()</a>, the caller's lock on the mutex is restored. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>timeout</em>&nbsp;</td><td>The amount of time in milliseconds to wait for the the condition's state to change. If zero, the default, then it waits for a state change without timing-out. If non-zero, and the indicated time elapses without a state change being signaled, then false is returned. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns true if the caller was wakened normally. Returns false if the wait timed out, or if invoked with a recursive mutex, which is an invalid invocation style. </dd></dl>
<dl class="remark" compact><dt><b>Remarks:</b></dt><dd>The reason that the mutex must not be locked recursively is because the implicit unlock performed by <a class="el" href="classcsCondition.html#2813394aecf8b91dbfa65499249fb88a" title="Wait for some change of condition.">Wait()</a> <em>must</em> actually release the mutex in order for other threads to be able to satisfy the condition. With recursively locked mutexes, there is no guarantee that the one implicit unlock operation performed by <a class="el" href="classcsCondition.html#2813394aecf8b91dbfa65499249fb88a" title="Wait for some change of condition.">Wait()</a> will actually release the mutex since it might have been locked multiple times within the same thread. </dd></dl>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>csutil/<a class="el" href="thread_8h-source.html">thread.h</a></ul>
<hr size="1"><address><small>Generated for Crystal Space 1.2.1 by 
<a href="http://www.doxygen.org/index.html">doxygen</a> 1.5.3 
</small></address> </div></body> </html>