⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 group___a_p_r___global_mutex.html

📁 apr函数库使用手册
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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">
</head><body>
<!-- Generated by Doxygen 1.3.7 -->
<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>Global Locking Routines</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#ga0">apr_global_mutex_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group___a_p_r___global_mutex.html#ga0">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#ga0">apr_status_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group___a_p_r___global_mutex.html#ga1">apr_global_mutex_create</a> (<a class="el" href="group___a_p_r___global_mutex.html#ga0">apr_global_mutex_t</a> **mutex, const char *fname, <a class="el" href="group__apr__proc__mutex.html#ga12">apr_lockmech_e</a> mech, <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___a_p_r___global_mutex.html#ga2">apr_global_mutex_child_init</a> (<a class="el" href="group___a_p_r___global_mutex.html#ga0">apr_global_mutex_t</a> **mutex, const char *fname, <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___a_p_r___global_mutex.html#ga3">apr_global_mutex_lock</a> (<a class="el" href="group___a_p_r___global_mutex.html#ga0">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#ga0">apr_status_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group___a_p_r___global_mutex.html#ga4">apr_global_mutex_trylock</a> (<a class="el" href="group___a_p_r___global_mutex.html#ga0">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#ga0">apr_status_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group___a_p_r___global_mutex.html#ga5">apr_global_mutex_unlock</a> (<a class="el" href="group___a_p_r___global_mutex.html#ga0">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#ga0">apr_status_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group___a_p_r___global_mutex.html#ga6">apr_global_mutex_destroy</a> (<a class="el" href="group___a_p_r___global_mutex.html#ga0">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#ga0">apr_pool_t</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="group___a_p_r___global_mutex.html#ga7">apr_global_mutex_pool_get</a> (const <a class="el" href="group___a_p_r___global_mutex.html#ga0">apr_global_mutex_t</a> *theglobal_mutex)</td></tr>

</table>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="ga0" doxytag="apr_global_mutex.h::apr_global_mutex_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___a_p_r___global_mutex.html#ga0">apr_global_mutex_t</a> <a class="el" href="group___a_p_r___global_mutex.html#ga0">apr_global_mutex_t</a>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Opaque global mutex structure.     </td>
  </tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga2" doxytag="apr_global_mutex.h::apr_global_mutex_child_init" ></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_global_mutex_child_init           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group___a_p_r___global_mutex.html#ga0">apr_global_mutex_t</a> **&nbsp;</td>
          <td class="mdname" nowrap> <em>mutex</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>fname</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></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></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>
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></td><td valign=top><em>mutex</em>&nbsp;</td><td>The newly re-opened mutex structure. </td></tr>
    <tr><td></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#ga1">apr_global_mutex_create()</a>. </td></tr>
    <tr><td></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>
    </td>
  </tr>
</table>
<a class="anchor" name="ga1" doxytag="apr_global_mutex.h::apr_global_mutex_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_global_mutex_create           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group___a_p_r___global_mutex.html#ga0">apr_global_mutex_t</a> **&nbsp;</td>
          <td class="mdname" nowrap> <em>mutex</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>fname</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="group__apr__proc__mutex.html#ga12">apr_lockmech_e</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>mech</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></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></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 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></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></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></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></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>
    </td>
  </tr>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -