diff options
author | Igor Sysoev <igor@sysoev.ru> | 2005-10-12 13:50:36 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2005-10-12 13:50:36 +0000 |
commit | 784522377ec160bc148ff3bb40fb87ede7506d5d (patch) | |
tree | 0c76a9c51a1c2ffa35ad3eb05e3b80f6cc19c60a /src/os/win32/ngx_atomic.h | |
parent | bbfe3033bc82427b15ccf73767e786cbb12a7627 (diff) | |
download | nginx-release-0.3.2.tar.gz |
nginx-0.3.2-RELEASE importrelease-0.3.2
*) Feature: the Sun Studio 10 C compiler support.
*) Feature: the "proxy_upstream_max_fails",
"proxy_upstream_fail_timeout", "fastcgi_upstream_max_fails", and
"fastcgi_upstream_fail_timeout" directives.
Diffstat (limited to 'src/os/win32/ngx_atomic.h')
-rw-r--r-- | src/os/win32/ngx_atomic.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/os/win32/ngx_atomic.h b/src/os/win32/ngx_atomic.h index 01ef98e97..87de57dd1 100644 --- a/src/os/win32/ngx_atomic.h +++ b/src/os/win32/ngx_atomic.h @@ -14,14 +14,10 @@ #define NGX_HAVE_ATOMIC_OPS 1 -typedef int32_t ngx_atomic_int_t; -typedef uint32_t ngx_atomic_uint_t; +typedef int32_t ngx_atomic_int_t; +typedef uint32_t ngx_atomic_uint_t; typedef volatile ngx_atomic_uint_t ngx_atomic_t; -#define NGX_ATOMIC_T_LEN sizeof("-2147483648") - 1 - - -#define ngx_atomic_inc(p) InterlockedIncrement((long *) p) -#define ngx_atomic_dec(p) InterlockedDecrement((long *) p) +#define NGX_ATOMIC_T_LEN sizeof("-2147483648") - 1 #if defined( __WATCOMC__ ) || defined( __BORLANDC__ ) || ( _MSC_VER >= 1300 ) @@ -42,6 +38,9 @@ typedef volatile ngx_atomic_uint_t ngx_atomic_t; #endif +#define ngx_atomic_fetch_add(p, add) InterlockedExchangeAdd((long *) p, add) + + void ngx_spinlock(ngx_atomic_t *lock, ngx_uint_t spin); #define ngx_trylock(lock) (*(lock) == 0 && ngx_atomic_cmp_set(lock, 0, 1)) |