Sophie

Sophie

distrib > Mandriva > 10.2 > i586 > by-pkgid > 4f37b923758ceff94a2c0ccca62b4b43 > files > 198

libapr1-devel-1.1.1-1mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Apache Portable Runtime: Condition Variable Routines</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.9.1 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>Condition Variable Routines<br>
<small>
[<a class="el" href="group__APR.html">Apache Portability Runtime library</a>]</small>
</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="el" href="group__apr__thread__cond.html#ga0">apr_thread_cond_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__thread__cond.html#ga0">apr_thread_cond_t</a></td></tr>

<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__thread__cond.html#ga1">apr_thread_cond_create</a> (<a class="el" href="group__apr__thread__cond.html#ga0">apr_thread_cond_t</a> **cond, <a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *pool)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__thread__cond.html#ga2">apr_thread_cond_wait</a> (<a class="el" href="group__apr__thread__cond.html#ga0">apr_thread_cond_t</a> *cond, <a class="el" href="group__apr__thread__mutex.html#ga0">apr_thread_mutex_t</a> *mutex)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__thread__cond.html#ga3">apr_thread_cond_timedwait</a> (<a class="el" href="group__apr__thread__cond.html#ga0">apr_thread_cond_t</a> *cond, <a class="el" href="group__apr__thread__mutex.html#ga0">apr_thread_mutex_t</a> *mutex, <a class="el" href="group__apr__time.html#ga3">apr_interval_time_t</a> timeout)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__thread__cond.html#ga4">apr_thread_cond_signal</a> (<a class="el" href="group__apr__thread__cond.html#ga0">apr_thread_cond_t</a> *cond)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__thread__cond.html#ga5">apr_thread_cond_broadcast</a> (<a class="el" href="group__apr__thread__cond.html#ga0">apr_thread_cond_t</a> *cond)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__thread__cond.html#ga6">apr_thread_cond_destroy</a> (<a class="el" href="group__apr__thread__cond.html#ga0">apr_thread_cond_t</a> *cond)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__thread__cond.html#ga7">apr_thread_cond_pool_get</a> (const <a class="el" href="group__apr__thread__cond.html#ga0">apr_thread_cond_t</a> *thethread_cond)</td></tr>

</table>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="ga0" doxytag="apr_thread_cond.h::apr_thread_cond_t"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">typedef struct <a class="el" href="group__apr__thread__cond.html#ga0">apr_thread_cond_t</a> <a class="el" href="group__apr__thread__cond.html#ga0">apr_thread_cond_t</a>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Opaque structure for thread condition variables     </td>
  </tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga5" doxytag="apr_thread_cond.h::apr_thread_cond_broadcast"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> apr_thread_cond_broadcast           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group__apr__thread__cond.html#ga0">apr_thread_cond_t</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>cond</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Signals all threads blocking on the given condition variable. Each thread that was signaled is then scheduled to wake up and acquire the associated mutex. This will happen in a serialized manner. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>cond</em>&nbsp;</td><td>the condition variable on which to produce the broadcast. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga1" doxytag="apr_thread_cond.h::apr_thread_cond_create"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> apr_thread_cond_create           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group__apr__thread__cond.html#ga0">apr_thread_cond_t</a> **&nbsp;</td>
          <td class="mdname" nowrap> <em>cond</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>pool</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Create and initialize a condition variable that can be used to signal and schedule threads in a single process. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>cond</em>&nbsp;</td><td>the memory address where the newly created condition variable will be stored. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pool</em>&nbsp;</td><td>the pool from which to allocate the mutex. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga6" doxytag="apr_thread_cond.h::apr_thread_cond_destroy"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> apr_thread_cond_destroy           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group__apr__thread__cond.html#ga0">apr_thread_cond_t</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>cond</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Destroy the condition variable and free the associated memory. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>cond</em>&nbsp;</td><td>the condition variable to destroy. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga7" doxytag="apr_thread_cond.h::apr_thread_cond_pool_get"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a>* apr_thread_cond_pool_get           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="group__apr__thread__cond.html#ga0">apr_thread_cond_t</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>thethread_cond</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get the pool used by this thread_cond. <dl compact><dt><b>Returns:</b></dt><dd>apr_pool_t the pool </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga4" doxytag="apr_thread_cond.h::apr_thread_cond_signal"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> apr_thread_cond_signal           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group__apr__thread__cond.html#ga0">apr_thread_cond_t</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>cond</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Signals a single thread, if one exists, that is blocking on the given condition variable. That thread is then scheduled to wake up and acquire the associated mutex. Although it is not required, if predictable scheduling is desired, that mutex must be locked while calling this function. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>cond</em>&nbsp;</td><td>the condition variable on which to produce the signal. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga3" doxytag="apr_thread_cond.h::apr_thread_cond_timedwait"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> apr_thread_cond_timedwait           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group__apr__thread__cond.html#ga0">apr_thread_cond_t</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>cond</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="group__apr__thread__mutex.html#ga0">apr_thread_mutex_t</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>mutex</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="group__apr__time.html#ga3">apr_interval_time_t</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>timeout</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Put the active calling thread to sleep until signaled to wake up or the timeout is reached. Each condition variable must be associated with a mutex, and that mutex must be locked before calling this function, or the behavior will be undefined. As the calling thread is put to sleep, the given mutex will be simultaneously released; and as this thread wakes up the lock is again simultaneously acquired. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>cond</em>&nbsp;</td><td>the condition variable on which to block. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>mutex</em>&nbsp;</td><td>the mutex that must be locked upon entering this function, is released while the thread is asleep, and is again acquired before returning from this function. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>timeout</em>&nbsp;</td><td>The amount of time in microseconds to wait. This is a maximum, not a minimum. If the condition is signaled, we will wake up before this time, otherwise the error APR_TIMEUP is returned. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga2" doxytag="apr_thread_cond.h::apr_thread_cond_wait"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> apr_thread_cond_wait           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group__apr__thread__cond.html#ga0">apr_thread_cond_t</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>cond</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="group__apr__thread__mutex.html#ga0">apr_thread_mutex_t</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>mutex</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Put the active calling thread to sleep until signaled to wake up. Each condition variable must be associated with a mutex, and that mutex must be locked before calling this function, or the behavior will be undefined. As the calling thread is put to sleep, the given mutex will be simultaneously released; and as this thread wakes up the lock is again simultaneously acquired. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>cond</em>&nbsp;</td><td>the condition variable on which to block. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>mutex</em>&nbsp;</td><td>the mutex that must be locked upon entering this function, is released while the thread is asleep, and is again acquired before returning from this function. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Sun Mar 20 19:52:28 2005 for Apache Portable Runtime by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address>
</body>
</html>