diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-09-22 20:18:21 +0400 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-09-22 20:18:21 +0400 |
commit | 85080d09ad785214243d60474d25894fcf24e27d (patch) | |
tree | 0f3198ccf0603955dfc33dec639d5ec115214b19 /src/os/unix/ngx_atomic.h | |
parent | f1602634ad817eb03bf7873641ed3c2bfa7223f6 (diff) |
nginx-0.0.11-2004-09-22-20:18:21 import
Diffstat (limited to 'src/os/unix/ngx_atomic.h')
-rw-r--r-- | src/os/unix/ngx_atomic.h | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/os/unix/ngx_atomic.h b/src/os/unix/ngx_atomic.h index 7f740381b..c5197e56e 100644 --- a/src/os/unix/ngx_atomic.h +++ b/src/os/unix/ngx_atomic.h @@ -8,6 +8,8 @@ #if ( __i386__ || __amd64__ ) +#define NGX_HAVE_ATOMIC_OPS 1 + typedef volatile uint32_t ngx_atomic_t; #if (NGX_SMP) @@ -33,6 +35,8 @@ static ngx_inline uint32_t ngx_atomic_inc(ngx_atomic_t *value) } +#if 0 + static ngx_inline uint32_t ngx_atomic_dec(ngx_atomic_t *value) { uint32_t old; @@ -48,6 +52,8 @@ static ngx_inline uint32_t ngx_atomic_dec(ngx_atomic_t *value) return old; } +#endif + static ngx_inline uint32_t ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_t old, @@ -70,6 +76,8 @@ static ngx_inline uint32_t ngx_atomic_cmp_set(ngx_atomic_t *lock, #elif ( __sparc__ ) +#define NGX_HAVE_ATOMIC_OPS 1 + typedef volatile uint32_t ngx_atomic_t; @@ -99,11 +107,6 @@ static ngx_inline uint32_t ngx_atomic_inc(ngx_atomic_t *value) } -/* STUB */ -#define ngx_atomic_dec(x) (*(x))--; -/**/ - - static ngx_inline uint32_t ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_t old, ngx_atomic_t set) @@ -121,13 +124,18 @@ static ngx_inline uint32_t ngx_atomic_cmp_set(ngx_atomic_t *lock, #else +#define NGX_HAVE_ATOMIC_OPS 0 + typedef volatile uint32_t ngx_atomic_t; -/* STUB */ -#define ngx_atomic_inc(x) ++(*(x)); -#define ngx_atomic_dec(x) --(*(x)); -#define ngx_atomic_cmp_set(lock, old, set) 1 -/**/ +#define ngx_atomic_inc(x) ++(*(x)); + +static ngx_inline uint32_t ngx_atomic_cmp_set(ngx_atomic_t *lock, + ngx_atomic_t old, + ngx_atomic_t set) +{ + return 1; +} #endif |