📄 group__apr__proc__mutex.html
字号:
<!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: Process 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 Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<h1>Process 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__apr__proc__mutex.html#ga0">apr_proc_mutex_t</a> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__proc__mutex.html#ga0">apr_proc_mutex_t</a></td></tr>
<tr><td colspan=2><br><h2>Enumerations</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>enum </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__proc__mutex.html#ga12">apr_lockmech_e</a> { <br>
<a class="el" href="group__apr__proc__mutex.html#gga12a1">APR_LOCK_FCNTL</a>,
<a class="el" href="group__apr__proc__mutex.html#gga12a2">APR_LOCK_FLOCK</a>,
<a class="el" href="group__apr__proc__mutex.html#gga12a3">APR_LOCK_SYSVSEM</a>,
<a class="el" href="group__apr__proc__mutex.html#gga12a4">APR_LOCK_PROC_PTHREAD</a>,
<br>
<a class="el" href="group__apr__proc__mutex.html#gga12a5">APR_LOCK_POSIXSEM</a>,
<a class="el" href="group__apr__proc__mutex.html#gga12a6">APR_LOCK_DEFAULT</a>
<br>
}</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> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__proc__mutex.html#ga1">apr_proc_mutex_create</a> (<a class="el" href="group__apr__proc__mutex.html#ga0">apr_proc_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> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__proc__mutex.html#ga2">apr_proc_mutex_child_init</a> (<a class="el" href="group__apr__proc__mutex.html#ga0">apr_proc_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> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__proc__mutex.html#ga3">apr_proc_mutex_lock</a> (<a class="el" href="group__apr__proc__mutex.html#ga0">apr_proc_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> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__proc__mutex.html#ga4">apr_proc_mutex_trylock</a> (<a class="el" href="group__apr__proc__mutex.html#ga0">apr_proc_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> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__proc__mutex.html#ga5">apr_proc_mutex_unlock</a> (<a class="el" href="group__apr__proc__mutex.html#ga0">apr_proc_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> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__proc__mutex.html#ga6">apr_proc_mutex_destroy</a> (<a class="el" href="group__apr__proc__mutex.html#ga0">apr_proc_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> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__proc__mutex.html#ga7">apr_proc_mutex_cleanup</a> (void *mutex)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>const char * </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__proc__mutex.html#ga8">apr_proc_mutex_lockfile</a> (<a class="el" href="group__apr__proc__mutex.html#ga0">apr_proc_mutex_t</a> *mutex)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>const char * </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__proc__mutex.html#ga9">apr_proc_mutex_name</a> (<a class="el" href="group__apr__proc__mutex.html#ga0">apr_proc_mutex_t</a> *mutex)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>const char * </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__proc__mutex.html#ga10">apr_proc_mutex_defname</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__proc__mutex.html#ga11">apr_proc_mutex_pool_get</a> (const <a class="el" href="group__apr__proc__mutex.html#ga0">apr_proc_mutex_t</a> *theproc_mutex)</td></tr>
</table>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="ga0" doxytag="apr_proc_mutex.h::apr_proc_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__apr__proc__mutex.html#ga0">apr_proc_mutex_t</a> <a class="el" href="group__apr__proc__mutex.html#ga0">apr_proc_mutex_t</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Opaque structure representing a process mutex. </td>
</tr>
</table>
<hr><h2>Enumeration Type Documentation</h2>
<a class="anchor" name="ga12" doxytag="apr_proc_mutex.h::apr_lockmech_e" ></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"> enum <a class="el" href="group__apr__proc__mutex.html#ga12">apr_lockmech_e</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Enumerated potential types for APR process locking methods <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>
<dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em><a class="anchor" name="gga12a1" doxytag="APR_LOCK_FCNTL" ></a>APR_LOCK_FCNTL</em> </td><td>
fcntl() </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga12a2" doxytag="APR_LOCK_FLOCK" ></a>APR_LOCK_FLOCK</em> </td><td>
flock() </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga12a3" doxytag="APR_LOCK_SYSVSEM" ></a>APR_LOCK_SYSVSEM</em> </td><td>
System V Semaphores </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga12a4" doxytag="APR_LOCK_PROC_PTHREAD" ></a>APR_LOCK_PROC_PTHREAD</em> </td><td>
POSIX pthread process-based locking </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga12a5" doxytag="APR_LOCK_POSIXSEM" ></a>APR_LOCK_POSIXSEM</em> </td><td>
POSIX semaphore process-based locking </td></tr>
<tr><td valign=top><em><a class="anchor" name="gga12a6" doxytag="APR_LOCK_DEFAULT" ></a>APR_LOCK_DEFAULT</em> </td><td>
Use the default process lock </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga2" doxytag="apr_proc_mutex.h::apr_proc_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_proc_mutex_child_init </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="group__apr__proc__mutex.html#ga0">apr_proc_mutex_t</a> ** </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 * </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> * </td>
<td class="mdname" nowrap> <em>pool</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</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> </td><td>The newly re-opened mutex structure. </td></tr>
<tr><td></td><td valign=top><em>fname</em> </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__apr__proc__mutex.html#ga1">apr_proc_mutex_create()</a>. </td></tr>
<tr><td></td><td valign=top><em>pool</em> </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="ga7" doxytag="apr_proc_mutex.h::apr_proc_mutex_cleanup" ></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_proc_mutex_cleanup </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void * </td>
<td class="mdname1" valign="top" nowrap> <em>mutex</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<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></td><td valign=top><em>mutex</em> </td><td>the mutex to destroy. </td></tr>
</table>
</dl>
<dl compact><dt><b>Note:</b></dt><dd>This function is generally used to kill a cleanup on an already created mutex </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga1" doxytag="apr_proc_mutex.h::apr_proc_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_proc_mutex_create </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="group__apr__proc__mutex.html#ga0">apr_proc_mutex_t</a> ** </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 * </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> </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> * </td>
<td class="mdname" nowrap> <em>pool</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Create and initialize a mutex that can be used to synchronize processes. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>mutex</em> </td><td>the memory address where the newly created mutex will be stored. </td></tr>
<tr><td></td><td valign=top><em>fname</em> </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> </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> </td><td>the pool from which to allocate the mutex. </td></tr>
</table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__apr__proc__mutex.html#ga12">apr_lockmech_e</a> </dd></dl>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -