diff options
author | ianh <ianh@13f79535-47bb-0310-9956-ffa450edef68> | 2002-02-21 23:34:10 +0000 |
---|---|---|
committer | ianh <ianh@13f79535-47bb-0310-9956-ffa450edef68> | 2002-02-21 23:34:10 +0000 |
commit | eab8eb4c5de9a79c74fae0649935a46bc389978c (patch) | |
tree | 415d5498520e3b7f8f70ad3cd91709368fc76f97 /include | |
parent | 16668c953e9dad58915ac525d6f29f71defabb3b (diff) | |
download | libapr-eab8eb4c5de9a79c74fae0649935a46bc389978c.tar.gz |
deal with the case where some processors in a product line are ancient and don't
have all the support we would like for atomic operations.
this is intended for the sparc v7's out there which don't do CAS
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63046 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include')
-rw-r--r-- | include/apr.h.in | 3 | ||||
-rw-r--r-- | include/apr_atomic.h | 22 |
2 files changed, 17 insertions, 8 deletions
diff --git a/include/apr.h.in b/include/apr.h.in index 46aa0f3a9..98a7cccd6 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -255,6 +255,9 @@ typedef @socklen_t_value@ apr_socklen_t; /* And APR_INT64_T_FMT */ @int64_t_fmt@ +/* are we going to force the generic atomic operations */ +#define APR_FORCE_ATOMIC_GENERIC @apr_force_atomic_generic@ + /* Local machine definition for console and log output. */ #define APR_EOL_STR "@eolstr@" diff --git a/include/apr_atomic.h b/include/apr_atomic.h index ec8404840..e0dbabe27 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -133,7 +133,13 @@ void apr_atomic_dec(volatile apr_atomic_t *mem); apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #else /* !DOXYGEN */ -#ifdef WIN32 +#if APR_FORCE_ATOMIC_GENERIC +#if APR_HAS_THREADS +#define APR_ATOMIC_NEED_DEFAULT 1 +#define APR_ATOMIC_NEED_CAS_DEFAULT 1 +#endif /* APR_HAS_THREADS */ + +#elif defined(WIN32) #define apr_atomic_t LONG; @@ -209,7 +215,13 @@ apr_uint32_t apr_atomic_cas_sparc(volatile apr_uint32_t *mem, long with, long cm #else #if APR_HAS_THREADS +#define APR_ATOMIC_NEED_DEFAULT 1 +#define APR_ATOMIC_NEED_CAS_DEFAULT 1 +#endif /* APR_HAS_THREADS */ + +#endif /* !defined(WIN32) && !defined(__linux) */ +#if defined(APR_ATOMIC_NEED_DEFAULT) #define apr_atomic_t apr_uint32_t #define apr_atomic_read(p) *p apr_status_t apr_atomic_init(apr_pool_t *p); @@ -217,13 +229,7 @@ void apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val); void apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val); void apr_atomic_inc(volatile apr_atomic_t *mem); void apr_atomic_dec(volatile apr_atomic_t *mem); - -#define APR_ATOMIC_NEED_DEFAULT 1 -#define APR_ATOMIC_NEED_CAS_DEFAULT 1 - -#endif /* APR_HAS_THREADS */ - -#endif /* !defined(WIN32) && !defined(__linux) */ +#endif #if defined(APR_ATOMIC_NEED_CAS_DEFAULT) apr_status_t apr_atomic_init(apr_pool_t *p); |