]> git.kaiwu.me - nginx.git/commitdiff
test Darwin 8 atomic(3)
authorIgor Sysoev <igor@sysoev.ru>
Fri, 22 Dec 2006 12:54:08 +0000 (12:54 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Fri, 22 Dec 2006 12:54:08 +0000 (12:54 +0000)
auto/os/conf
src/os/unix/ngx_atomic.h

index 806beb9e9c43c51cf64dd447ee58830cac56d36b..b34be7245370c3c006fd928487caa83d42f1c04a 100644 (file)
@@ -42,6 +42,16 @@ case "$NGX_PLATFORM" in
         CORE_INCS="$UNIX_INCS"
         CORE_DEPS="$UNIX_DEPS $POSIX_DEPS"
         CORE_SRCS="$UNIX_SRCS"
+
+        ngx_feature="atomic(3)"
+        ngx_feature_name=NGX_DARWIN_ATOMIC
+        ngx_feature_run=no
+        ngx_feature_incs="#include <libkern/OSAtomic.h>"
+        ngx_feature_path=
+        ngx_feature_libs=
+        ngx_feature_test="int32_t  lock, n;
+                          n = OSAtomicCompareAndSwap32Barrier(0, 1, lock)"
+        . auto/feature
     ;;
 
     HP-UX:*)
index 593f671ce9483c4c70f4186c676b1308681aaf27..c0734e12e835185714b32da099cdce347656652e 100644 (file)
 #include <ngx_core.h>
 
 
-#if (NGX_DARWIN)
+#if (NGX_DARWIN_ATOMIC)
 
 /*
- * use MacOSX atomic(3) and barrier(3) operations
- * optimized at run time for UP and SMP
+ * use Darwin 8 atomic(3) and barrier(3) operations
+ * optimized at run-time for UP and SMP
  */
 
 #include <libkern/OSAtomic.h>