Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > bdbf07027827e6ad7d9208f8a9eaea97 > files > 103

apr-docs-1.2.7-11.el5_6.5.x86_64.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: Global Locking Routines</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.7 -->
<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="annotated.html"><span>Data&nbsp;Structures</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>
    <li><a href="examples.html"><span>Examples</span></a></li>
  </ul></div>
<h1>Global Locking Routines<br>
<small>
[<a class="el" href="group___a_p_r.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___a_p_r___global_mutex.html#g51a8685483b49232504b4dfc55e762b8">apr_global_mutex_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___a_p_r___global_mutex.html#g51a8685483b49232504b4dfc55e762b8">apr_global_mutex_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#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___a_p_r___global_mutex.html#ga06d6fd1f5d833a899879dc0d4e5301d">apr_global_mutex_create</a> (<a class="el" href="group___a_p_r___global_mutex.html#g51a8685483b49232504b4dfc55e762b8">apr_global_mutex_t</a> **mutex, const char *fname, <a class="el" href="group__apr__proc__mutex.html#gada99139636a0bedceec1c967068de0e">apr_lockmech_e</a> mech, <a class="el" href="group__apr__pools.html#g06f17a7732f2d04d8ce7010fbb057a8b">apr_pool_t</a> *pool)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___a_p_r___global_mutex.html#gcb5b2e489700587374cf4b3198f8140d">apr_global_mutex_child_init</a> (<a class="el" href="group___a_p_r___global_mutex.html#g51a8685483b49232504b4dfc55e762b8">apr_global_mutex_t</a> **mutex, const char *fname, <a class="el" href="group__apr__pools.html#g06f17a7732f2d04d8ce7010fbb057a8b">apr_pool_t</a> *pool)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___a_p_r___global_mutex.html#gea6746fec7dd8cce408e94ea4fcead64">apr_global_mutex_lock</a> (<a class="el" href="group___a_p_r___global_mutex.html#g51a8685483b49232504b4dfc55e762b8">apr_global_mutex_t</a> *mutex)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___a_p_r___global_mutex.html#g4cbb825fe02b3a80566bec469278ae15">apr_global_mutex_trylock</a> (<a class="el" href="group___a_p_r___global_mutex.html#g51a8685483b49232504b4dfc55e762b8">apr_global_mutex_t</a> *mutex)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___a_p_r___global_mutex.html#g80a2c05e4e88fdb6adab8d66e22f8cde">apr_global_mutex_unlock</a> (<a class="el" href="group___a_p_r___global_mutex.html#g51a8685483b49232504b4dfc55e762b8">apr_global_mutex_t</a> *mutex)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___a_p_r___global_mutex.html#gfc3bb40f5582779550b7d4cc78879fa5">apr_global_mutex_destroy</a> (<a class="el" href="group___a_p_r___global_mutex.html#g51a8685483b49232504b4dfc55e762b8">apr_global_mutex_t</a> *mutex)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__apr__pools.html#g06f17a7732f2d04d8ce7010fbb057a8b">apr_pool_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___a_p_r___global_mutex.html#geda8b6c905485dbda3d6c57ac35a8238">apr_global_mutex_pool_get</a> (const <a class="el" href="group___a_p_r___global_mutex.html#g51a8685483b49232504b4dfc55e762b8">apr_global_mutex_t</a> *theglobal_mutex)</td></tr>

</table>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="g51a8685483b49232504b4dfc55e762b8"></a><!-- doxytag: member="apr_global_mutex.h::apr_global_mutex_t" ref="g51a8685483b49232504b4dfc55e762b8" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="group___a_p_r___global_mutex.html#g51a8685483b49232504b4dfc55e762b8">apr_global_mutex_t</a> <a class="el" href="group___a_p_r___global_mutex.html#g51a8685483b49232504b4dfc55e762b8">apr_global_mutex_t</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Opaque global mutex structure. 
</div>
</div><p>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="gcb5b2e489700587374cf4b3198f8140d"></a><!-- doxytag: member="apr_global_mutex.h::apr_global_mutex_child_init" ref="gcb5b2e489700587374cf4b3198f8140d" args="(apr_global_mutex_t **mutex, const char *fname, apr_pool_t *pool)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a> apr_global_mutex_child_init           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___a_p_r___global_mutex.html#g51a8685483b49232504b4dfc55e762b8">apr_global_mutex_t</a> **&nbsp;</td>
          <td class="paramname"> <em>mutex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>fname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__apr__pools.html#g06f17a7732f2d04d8ce7010fbb057a8b">apr_pool_t</a> *&nbsp;</td>
          <td class="paramname"> <em>pool</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Re-open a mutex in a child 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>mutex</em>&nbsp;</td><td>The newly re-opened mutex structure. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>fname</em>&nbsp;</td><td>A file name to use if the mutex mechanism requires one. This argument should always be provided. The mutex code itself will determine if it should be used. This filename should be the same one that was passed to <a class="el" href="group___a_p_r___global_mutex.html#ga06d6fd1f5d833a899879dc0d4e5301d">apr_global_mutex_create()</a>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pool</em>&nbsp;</td><td>The pool to operate on. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd>This function must be called to maintain portability, even if the underlying lock mechanism does not require it. </dd></dl>

</div>
</div><p>
<a class="anchor" name="ga06d6fd1f5d833a899879dc0d4e5301d"></a><!-- doxytag: member="apr_global_mutex.h::apr_global_mutex_create" ref="ga06d6fd1f5d833a899879dc0d4e5301d" args="(apr_global_mutex_t **mutex, const char *fname, apr_lockmech_e mech, apr_pool_t *pool)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a> apr_global_mutex_create           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___a_p_r___global_mutex.html#g51a8685483b49232504b4dfc55e762b8">apr_global_mutex_t</a> **&nbsp;</td>
          <td class="paramname"> <em>mutex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>fname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__apr__proc__mutex.html#gada99139636a0bedceec1c967068de0e">apr_lockmech_e</a>&nbsp;</td>
          <td class="paramname"> <em>mech</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__apr__pools.html#g06f17a7732f2d04d8ce7010fbb057a8b">apr_pool_t</a> *&nbsp;</td>
          <td class="paramname"> <em>pool</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Create and initialize a mutex that can be used to synchronize both processes and threads. Note: There is considerable overhead in using this API if only cross-process or cross-thread mutual exclusion is required. See <a class="el" href="apr__proc__mutex_8h.html">apr_proc_mutex.h</a> and <a class="el" href="apr__thread__mutex_8h.html">apr_thread_mutex.h</a> for more specialized lock routines. <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 memory address where the newly created mutex will be stored. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>fname</em>&nbsp;</td><td>A file name to use if the lock mechanism requires one. This argument should always be provided. The lock code itself will determine if it should be used. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>mech</em>&nbsp;</td><td>The mechanism to use for the interprocess lock, if any; one of <pre>
            APR_LOCK_FCNTL
            APR_LOCK_FLOCK
            APR_LOCK_SYSVSEM
            APR_LOCK_POSIXSEM
            APR_LOCK_PROC_PTHREAD
            APR_LOCK_DEFAULT     pick the default mechanism for the platform
 </pre> </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>
<dl compact><dt><b>Warning:</b></dt><dd>Check APR_HAS_foo_SERIALIZE defines to see if the platform supports APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable. </dd></dl>

</div>
</div><p>
<a class="anchor" name="gfc3bb40f5582779550b7d4cc78879fa5"></a><!-- doxytag: member="apr_global_mutex.h::apr_global_mutex_destroy" ref="gfc3bb40f5582779550b7d4cc78879fa5" args="(apr_global_mutex_t *mutex)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a> apr_global_mutex_destroy           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___a_p_r___global_mutex.html#g51a8685483b49232504b4dfc55e762b8">apr_global_mutex_t</a> *&nbsp;</td>
          <td class="paramname"> <em>mutex</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destroy the mutex and free the memory associated with the lock. <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 destroy. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="gea6746fec7dd8cce408e94ea4fcead64"></a><!-- doxytag: member="apr_global_mutex.h::apr_global_mutex_lock" ref="gea6746fec7dd8cce408e94ea4fcead64" args="(apr_global_mutex_t *mutex)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a> apr_global_mutex_lock           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___a_p_r___global_mutex.html#g51a8685483b49232504b4dfc55e762b8">apr_global_mutex_t</a> *&nbsp;</td>
          <td class="paramname"> <em>mutex</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Acquire the lock for the given mutex. If the mutex is already locked, the current thread will be put to sleep until the lock becomes available. <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 on which to acquire the lock. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="geda8b6c905485dbda3d6c57ac35a8238"></a><!-- doxytag: member="apr_global_mutex.h::apr_global_mutex_pool_get" ref="geda8b6c905485dbda3d6c57ac35a8238" args="(const apr_global_mutex_t *theglobal_mutex)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__apr__pools.html#g06f17a7732f2d04d8ce7010fbb057a8b">apr_pool_t</a>* apr_global_mutex_pool_get           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group___a_p_r___global_mutex.html#g51a8685483b49232504b4dfc55e762b8">apr_global_mutex_t</a> *&nbsp;</td>
          <td class="paramname"> <em>theglobal_mutex</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the pool used by this global_mutex. <dl compact><dt><b>Returns:</b></dt><dd>apr_pool_t the pool </dd></dl>

</div>
</div><p>
<a class="anchor" name="g4cbb825fe02b3a80566bec469278ae15"></a><!-- doxytag: member="apr_global_mutex.h::apr_global_mutex_trylock" ref="g4cbb825fe02b3a80566bec469278ae15" args="(apr_global_mutex_t *mutex)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a> apr_global_mutex_trylock           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___a_p_r___global_mutex.html#g51a8685483b49232504b4dfc55e762b8">apr_global_mutex_t</a> *&nbsp;</td>
          <td class="paramname"> <em>mutex</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Attempt to acquire the lock for the given mutex. If the mutex has already been acquired, the call returns immediately with APR_EBUSY. Note: it is important that the <a class="el" href="group___a_p_r___s_t_a_t_u_s___i_s.html#g88ed418f02b78468b542932ed2cb2c29">APR_STATUS_IS_EBUSY(s)</a> macro be used to determine if the return value was APR_EBUSY, for portability reasons. <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 on which to attempt the lock acquiring. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="g80a2c05e4e88fdb6adab8d66e22f8cde"></a><!-- doxytag: member="apr_global_mutex.h::apr_global_mutex_unlock" ref="g80a2c05e4e88fdb6adab8d66e22f8cde" args="(apr_global_mutex_t *mutex)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a> apr_global_mutex_unlock           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___a_p_r___global_mutex.html#g51a8685483b49232504b4dfc55e762b8">apr_global_mutex_t</a> *&nbsp;</td>
          <td class="paramname"> <em>mutex</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Release the lock for the given mutex. <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 from which to release the lock. </td></tr>
  </table>
</dl>

</div>
</div><p>
<hr size="1"><address style="align: right;"><small>Generated on Tue May 31 12:20:26 2011 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.4.7 </small></address>
</body>
</html>