nginx-0.0.11-2004-09-22-20:18:21 import
diff --git a/src/os/unix/ngx_atomic.h b/src/os/unix/ngx_atomic.h
index 7f74038..c5197e5 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 @@
}
+#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
diff --git a/src/os/win32/ngx_atomic.h b/src/os/win32/ngx_atomic.h
index fcc3ff1..9d75fab 100644
--- a/src/os/win32/ngx_atomic.h
+++ b/src/os/win32/ngx_atomic.h
@@ -6,17 +6,23 @@
#include <ngx_core.h>
+#define NGX_HAVE_ATOMIC_OPS 1
+
+
#define ngx_atomic_inc(p) InterlockedIncrement((long *) p)
-#define ngx_atomic_dec(p) InterlockedDecrement((long *) p)
#if defined( __WATCOMC__ ) || defined( __BORLANDC__ )
+/* the new SDK headers */
+
#define ngx_atomic_cmp_set(lock, old, set) \
(InterlockedCompareExchange((long *) lock, set, old) == old)
#else
+/* the old MS VC6.0SP2 SDK headers */
+
#define ngx_atomic_cmp_set(lock, old, set) \
(InterlockedCompareExchange((void **) lock, (void *) set, (void *) old) \
== (void *) old)