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
+++ 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_in
 }
 
 
+#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_de
     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_cm
 
 #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_in
 }
 
 
-/* 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_cm
 
 #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