Mercurial > hg > nginx
diff src/os/unix/ngx_atomic.h @ 435:5cdc4838d4e8
nginx-0.0.11-2004-09-22-20:18:21 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 22 Sep 2004 16:18:21 +0000 |
parents | 9a97dcdd2421 |
children | da8c5707af39 |
line wrap: on
line diff
--- a/src/os/unix/ngx_atomic.h Tue Sep 21 19:55:00 2004 +0000 +++ b/src/os/unix/ngx_atomic.h Wed Sep 22 16:18:21 2004 +0000 @@ -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 @@ } +#if 0 + static ngx_inline uint32_t ngx_atomic_dec(ngx_atomic_t *value) { uint32_t old; @@ -48,6 +52,8 @@ return old; } +#endif + static ngx_inline uint32_t ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_t old, @@ -70,6 +76,8 @@ #elif ( __sparc__ ) +#define NGX_HAVE_ATOMIC_OPS 1 + typedef volatile uint32_t ngx_atomic_t; @@ -99,11 +107,6 @@ } -/* 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 @@ #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