summaryrefslogtreecommitdiffhomepage
path: root/src/os/unix/ngx_atomic.h
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-06-30 15:30:41 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-06-30 15:30:41 +0000
commit078d1b2c2263690f2f6b7217b567eeeb525910d0 (patch)
treedfb82cccd10c3dee8a500506f7692b0445200e5c /src/os/unix/ngx_atomic.h
parent0a94cfd2ae9ca87b4d988b5066f739a3034f3bff (diff)
downloadnginx-078d1b2c2263690f2f6b7217b567eeeb525910d0.tar.gz
nginx-078d1b2c2263690f2f6b7217b567eeeb525910d0.tar.bz2
nginx-0.0.7-2004-06-30-19:30:41 import
Diffstat (limited to '')
-rw-r--r--src/os/unix/ngx_atomic.h (renamed from src/core/ngx_atomic.h)20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/core/ngx_atomic.h b/src/os/unix/ngx_atomic.h
index a149ad28b..18d5edac5 100644
--- a/src/core/ngx_atomic.h
+++ b/src/os/unix/ngx_atomic.h
@@ -68,24 +68,6 @@ static ngx_inline uint32_t ngx_atomic_cmp_set(ngx_atomic_t *lock,
}
-#elif (WIN32)
-
-#define ngx_atomic_inc(p) InterlockedIncrement((long *) p)
-#define ngx_atomic_dec(p) InterlockedDecrement((long *) p)
-
-#if defined(__WATCOMC__) || defined(__BORLANDC__)
-
-#define ngx_atomic_cmp_set(lock, old, set) \
- (InterlockedCompareExchange((long *) lock, set, old) == old)
-
-#else
-
-#define ngx_atomic_cmp_set(lock, old, set) \
- (InterlockedCompareExchange((void **) lock, (void *) set, (void *) old) \
- == (void *) old)
-
-#endif
-
#else
typedef volatile uint32_t ngx_atomic_t;
@@ -99,6 +81,8 @@ typedef volatile uint32_t ngx_atomic_t;
#endif
+void ngx_spinlock(ngx_atomic_t *lock, ngx_uint_t spin);
+
#define ngx_trylock(lock) (*(lock) == 0 && ngx_atomic_cmp_set(lock, 0, 1))
#define ngx_unlock(lock) *(lock) = 0