From c4d1b096cb24b7517728e09c83e6002a24f74650 Mon Sep 17 00:00:00 2001 From: trawick Date: Wed, 3 Dec 2003 00:04:42 +0000 Subject: move the implementations of apr atomics out of the public header file in order to . aid in keeping the different flavors consistent . prevent bug fixes from requiring that apps be rebuilt Reviewed and/or fixed by: Brad Nicholes, Greg Marr git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64803 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/netware/apr_atomic.c | 51 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) (limited to 'atomic/netware') diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c index 243c0f576..9c8dfea1b 100644 --- a/atomic/netware/apr_atomic.c +++ b/atomic/netware/apr_atomic.c @@ -52,13 +52,58 @@ * . */ - #include "apr.h" #include "apr_atomic.h" -int apr_atomic_dec(apr_atomic_t *mem) +#include + +APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *pool) +{ + return APR_SUCCESS; +} + +APR_DECLARE(void) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + atomic_add((unsigned long *)mem,(unsigned long)val); +} + +APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + atomic_sub((unsigned long *)mem,(unsigned long)val); +} + +APR_DECLARE(void) apr_atomic_inc32(volatile apr_uint32_t *mem) +{ + atomic_inc((unsigned long *)mem); +} + +APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) { - atomic_dec(mem); + *mem = val; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem) +{ + return *mem; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with,apr_uint32_t cmp) +{ + return atomic_cmpxchg((unsigned long *)mem,(unsigned long)cmp,(unsigned long)with); +} + +APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + return atomic_xchg((unsigned long *)mem,(unsigned long)val); +} + +APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) +{ + atomic_dec((unsigned long *)mem); return *mem; } +APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +{ + return (void*)atomic_cmpxchg((unsigned long *)mem,(unsigned long)cmp,(unsigned long)with); +} -- cgit v1.2.1