Sophie

Sophie

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

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: CS::Threading::Condition 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>
<div class="nav">
<a class="el" href="namespaceCS.html">CS</a>::<a class="el" href="namespaceCS_1_1Threading.html">Threading</a>::<a class="el" href="classCS_1_1Threading_1_1Condition.html">Condition</a></div>
<h1>CS::Threading::Condition Class Reference</h1><!-- doxytag: class="CS::Threading::Condition" --><!-- doxytag: inherits="CS::Implementation::NonCopyable_" --><a class="el" href="classCS_1_1Threading_1_1Condition.html" title="Condition variable.">Condition</a> variable.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="condition_8h-source.html">csutil/threading/condition.h</a>&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for CS::Threading::Condition:</div>
<div class="dynsection">
<p><center><img src="classCS_1_1Threading_1_1Condition__inherit__graph.png" border="0" usemap="#CS_1_1Threading_1_1Condition__inherit__map" alt="Inheritance graph"></center>
<map name="CS_1_1Threading_1_1Condition__inherit__map">
<area shape="rect" href="classCS_1_1Implementation_1_1NonCopyable__.html" title="Base&#45;class which ensures that derived classes are not copy&#45;constructible or assignable..." alt="" coords="28,7,164,33"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>

<p>
<a href="classCS_1_1Threading_1_1Condition-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"><a class="anchor" name="090da67a5672e6092ab917d71999d878"></a><!-- doxytag: member="CS::Threading::Condition::Condition" ref="090da67a5672e6092ab917d71999d878" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCS_1_1Threading_1_1Condition.html#090da67a5672e6092ab917d71999d878">Condition</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCS_1_1Threading_1_1Condition.html#7434ea57fb4d50d997dfe9c5146d0107">NotifyAll</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Notify and wake up all threads currently waiting for the condition.  <a href="#7434ea57fb4d50d997dfe9c5146d0107"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCS_1_1Threading_1_1Condition.html#8713c7f7c44839dc1d003522e0984711">NotifyOne</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Notify and wake up one thread waiting for the condition.  <a href="#8713c7f7c44839dc1d003522e0984711"></a><br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2">template&lt;typename LockType&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classCS_1_1Threading_1_1Condition.html#37100c936bfb1e6c7b7a3f5aaabd75ff">Wait</a> (LockType &amp;lock, <a class="el" href="group__util.html#g28e82998c4c2d1197a1d412bba7da793">csTicks</a> timeout=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wait for some change of condition.  <a href="#37100c936bfb1e6c7b7a3f5aaabd75ff"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<a class="el" href="classCS_1_1Threading_1_1Condition.html" title="Condition variable.">Condition</a> variable. 
<p>
A condition variable is a synchronization primitive used to have threads wait for a shared state variable to attain a given value. 
<p>Definition at line <a class="el" href="condition_8h-source.html#l00043">43</a> of file <a class="el" href="condition_8h-source.html">condition.h</a>.</p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="7434ea57fb4d50d997dfe9c5146d0107"></a><!-- doxytag: member="CS::Threading::Condition::NotifyAll" ref="7434ea57fb4d50d997dfe9c5146d0107" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CS::Threading::Condition::NotifyAll           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Notify and wake up all threads currently waiting for the condition. 
<p>
The order different threads get woke up is indeterminate. 
<p>Definition at line <a class="el" href="condition_8h-source.html#l00063">63</a> of file <a class="el" href="condition_8h-source.html">condition.h</a>.</p>

<p>Referenced by <a class="el" href="queue_8h-source.html#l00118">CS::SndSys::Queue&lt; CS::SndSys::SndSysBasicStream::StreamNotificationEvent &gt;::Clear()</a>.</p>

</div>
</div><p>
<a class="anchor" name="8713c7f7c44839dc1d003522e0984711"></a><!-- doxytag: member="CS::Threading::Condition::NotifyOne" ref="8713c7f7c44839dc1d003522e0984711" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CS::Threading::Condition::NotifyOne           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Notify and wake up one thread waiting for the condition. 
<p>

<p>Definition at line <a class="el" href="condition_8h-source.html#l00054">54</a> of file <a class="el" href="condition_8h-source.html">condition.h</a>.</p>

<p>Referenced by <a class="el" href="queue_8h-source.html#l00137">CS::SndSys::Queue&lt; CS::SndSys::SndSysBasicStream::StreamNotificationEvent &gt;::QueueEntry()</a>.</p>

</div>
</div><p>
<a class="anchor" name="37100c936bfb1e6c7b7a3f5aaabd75ff"></a><!-- doxytag: member="CS::Threading::Condition::Wait" ref="37100c936bfb1e6c7b7a3f5aaabd75ff" args="(LockType &amp;lock, csTicks timeout=0)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename LockType&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool CS::Threading::Condition::Wait           </td>
          <td>(</td>
          <td class="paramtype">LockType &amp;&nbsp;</td>
          <td class="paramname"> <em>lock</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> [inline]</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 Notify() or <a class="el" href="classCS_1_1Threading_1_1Condition.html#7434ea57fb4d50d997dfe9c5146d0107" title="Notify and wake up all threads currently waiting for the condition.">NotifyAll()</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>lock</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="classCS_1_1Threading_1_1Condition.html#37100c936bfb1e6c7b7a3f5aaabd75ff" 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="classCS_1_1Threading_1_1Condition.html#37100c936bfb1e6c7b7a3f5aaabd75ff" 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="classCS_1_1Threading_1_1Condition.html#37100c936bfb1e6c7b7a3f5aaabd75ff" 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>Timeout in milliseconds for the wait. A value of 0 means infinite wait. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd><code>true</code> when the condition was changed, or <code>false</code> if the wait timed out. </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="classCS_1_1Threading_1_1Condition.html#37100c936bfb1e6c7b7a3f5aaabd75ff" 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="classCS_1_1Threading_1_1Condition.html#37100c936bfb1e6c7b7a3f5aaabd75ff" 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. <p>
Having to use a timed wait may indicate a code flaw. Try to avoid timed waits and instead fix your synchronization logic. </dd></dl>

<p>Definition at line <a class="el" href="condition_8h-source.html#l00093">93</a> of file <a class="el" href="condition_8h-source.html">condition.h</a>.</p>

<p>Referenced by <a class="el" href="queue_8h-source.html#l00179">CS::SndSys::Queue&lt; CS::SndSys::SndSysBasicStream::StreamNotificationEvent &gt;::DequeueEntry()</a>.</p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>csutil/threading/<a class="el" href="condition_8h-source.html">condition.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>