summaryrefslogtreecommitdiff
path: root/atomic/netware
diff options
context:
space:
mode:
authortrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2003-12-03 00:04:42 +0000
committertrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2003-12-03 00:04:42 +0000
commitc4d1b096cb24b7517728e09c83e6002a24f74650 (patch)
treed7b9c057bb11388c9f3d648fbac009a1f545bc30 /atomic/netware
parentc49bf83561cc6651a961a2ab0939b6ddc0b3d172 (diff)
downloadlibapr-c4d1b096cb24b7517728e09c83e6002a24f74650.tar.gz
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
Diffstat (limited to 'atomic/netware')
-rw-r--r--atomic/netware/apr_atomic.c51
1 files changed, 48 insertions, 3 deletions
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 @@
* <http://www.apache.org/>.
*/
-
#include "apr.h"
#include "apr_atomic.h"
-int apr_atomic_dec(apr_atomic_t *mem)
+#include <stdlib.h>
+
+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);
+}