]> git.kaiwu.me - nginx.git/commitdiff
use light-weight sync on ppc64
authorIgor Sysoev <igor@sysoev.ru>
Tue, 19 Dec 2006 15:23:20 +0000 (15:23 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 19 Dec 2006 15:23:20 +0000 (15:23 +0000)
src/os/unix/ngx_gcc_atomic_ppc.h

index 147c44f31699845a55523a024c73ae9a8e7b1fb8..68d244e41290fdeba2bfbbbe0162ebe5541e29f1 100644 (file)
@@ -67,6 +67,13 @@ ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add)
     return res;
 }
 
+
+#if (NGX_SMP)
+#define ngx_memory_barrier()   __asm__ volatile ("lwsync\n" ::: "memory")
+#else
+#define ngx_memory_barrier()   __asm__ volatile ("" ::: "memory")
+#endif
+
 #else
 
 static ngx_inline ngx_atomic_uint_t
@@ -117,8 +124,6 @@ ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add)
     return res;
 }
 
-#endif
-
 
 #if (NGX_SMP)
 #define ngx_memory_barrier()   __asm__ volatile ("sync\n" ::: "memory")
@@ -126,4 +131,7 @@ ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add)
 #define ngx_memory_barrier()   __asm__ volatile ("" ::: "memory")
 #endif
 
+#endif
+
+
 #define ngx_cpu_pause()