📄 group__apr__atomic.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: Atomic Operations</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>Atomic Operations</h1><table border=0 cellpadding=0 cellspacing=0>
<tr><td></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__atomic.html#ga0">apr_atomic_init</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *p)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>apr_uint32_t </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__atomic.html#ga1">apr_atomic_read32</a> (volatile apr_uint32_t *mem)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__atomic.html#ga2">apr_atomic_set32</a> (volatile apr_uint32_t *mem, apr_uint32_t val)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>apr_uint32_t </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__atomic.html#ga3">apr_atomic_add32</a> (volatile apr_uint32_t *mem, apr_uint32_t val)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__atomic.html#ga4">apr_atomic_sub32</a> (volatile apr_uint32_t *mem, apr_uint32_t val)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>apr_uint32_t </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__atomic.html#ga5">apr_atomic_inc32</a> (volatile apr_uint32_t *mem)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__atomic.html#ga6">apr_atomic_dec32</a> (volatile apr_uint32_t *mem)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>apr_uint32_t </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__atomic.html#ga7">apr_atomic_cas32</a> (volatile apr_uint32_t *mem, apr_uint32_t with, apr_uint32_t cmp)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>apr_uint32_t </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__atomic.html#ga8">apr_atomic_xchg32</a> (volatile apr_uint32_t *mem, apr_uint32_t val)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void * </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__atomic.html#ga9">apr_atomic_casptr</a> (volatile void **mem, void *with, const void *cmp)</td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga3" doxytag="apr_atomic.h::apr_atomic_add32" ></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"> apr_uint32_t apr_atomic_add32 </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">volatile apr_uint32_t * </td>
<td class="mdname" nowrap> <em>mem</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>apr_uint32_t </td>
<td class="mdname" nowrap> <em>val</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>
atomically add 'val' to an apr_uint32_t <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>mem</em> </td><td>pointer to the object </td></tr>
<tr><td></td><td valign=top><em>val</em> </td><td>amount to add </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>old value pointed to by mem </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga7" doxytag="apr_atomic.h::apr_atomic_cas32" ></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"> apr_uint32_t apr_atomic_cas32 </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">volatile apr_uint32_t * </td>
<td class="mdname" nowrap> <em>mem</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>apr_uint32_t </td>
<td class="mdname" nowrap> <em>with</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>apr_uint32_t </td>
<td class="mdname" nowrap> <em>cmp</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>
compare an apr_uint32_t's value with 'cmp'. If they are the same swap the value with 'with' <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>mem</em> </td><td>pointer to the value </td></tr>
<tr><td></td><td valign=top><em>with</em> </td><td>what to swap it with </td></tr>
<tr><td></td><td valign=top><em>cmp</em> </td><td>the value to compare it to </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>the old value of *mem </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga9" doxytag="apr_atomic.h::apr_atomic_casptr" ></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"> void* apr_atomic_casptr </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">volatile void ** </td>
<td class="mdname" nowrap> <em>mem</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>void * </td>
<td class="mdname" nowrap> <em>with</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const void * </td>
<td class="mdname" nowrap> <em>cmp</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>
compare the pointer's value with cmp. If they are the same swap the value with 'with' <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>mem</em> </td><td>pointer to the pointer </td></tr>
<tr><td></td><td valign=top><em>with</em> </td><td>what to swap it with </td></tr>
<tr><td></td><td valign=top><em>cmp</em> </td><td>the value to compare it to </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>the old value of the pointer </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga6" doxytag="apr_atomic.h::apr_atomic_dec32" ></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"> int apr_atomic_dec32 </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">volatile apr_uint32_t * </td>
<td class="mdname1" valign="top" nowrap> <em>mem</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>
atomically decrement an apr_uint32_t by 1 <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>mem</em> </td><td>pointer to the atomic value </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>zero if the value becomes zero on decrement, otherwise non-zero </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga5" doxytag="apr_atomic.h::apr_atomic_inc32" ></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"> apr_uint32_t apr_atomic_inc32 </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">volatile apr_uint32_t * </td>
<td class="mdname1" valign="top" nowrap> <em>mem</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -