summaryrefslogtreecommitdiff
path: root/atomic
diff options
context:
space:
mode:
authorBradley Nicholes <bnicholes@apache.org>2003-12-08 21:44:31 +0000
committerBradley Nicholes <bnicholes@apache.org>2003-12-08 21:44:31 +0000
commitd85f999c2351c3f8fb202a0d1b27671acc540258 (patch)
tree967d6f3bc4d9464e9784d71b3f46f45892e79068 /atomic
parent410c6b42740adb3a7c7f725d22f148fcfdfd56c8 (diff)
downloadapr-d85f999c2351c3f8fb202a0d1b27671acc540258.tar.gz
Switch to a pure atomic implementation
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64817 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'atomic')
-rw-r--r--atomic/netware/apr_atomic.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c
index 3d68e3f88..53f88bfb1 100644
--- a/atomic/netware/apr_atomic.c
+++ b/atomic/netware/apr_atomic.c
@@ -64,9 +64,7 @@ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *pool)
APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val)
{
- apr_uint32_t old = *mem;
- atomic_add((unsigned long *)mem,(unsigned long)val);
- return old;
+ return atomic_xchgadd((unsigned long *)mem,(unsigned long)val);
}
APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val)
@@ -76,9 +74,7 @@ APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val)
APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem)
{
- apr_uint32_t old = *mem;
- atomic_inc((unsigned long *)mem);
- return old;
+ return atomic_xchgadd((unsigned long *)mem, 1);
}
APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val)