From 37835d905637553e33f09ed56ef1975e0e5aeef3 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Fri, 27 Nov 2009 22:00:39 +0000 Subject: atomic operations test-run --- auto/cc/conf | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'auto/cc') diff --git a/auto/cc/conf b/auto/cc/conf index 8916ad095..a7c8a0946 100644 --- a/auto/cc/conf +++ b/auto/cc/conf @@ -127,13 +127,18 @@ if [ "$NGX_PLATFORM" != win32 ]; then ngx_feature="gcc builtin atomic operations" ngx_feature_name=NGX_HAVE_GCC_ATOMIC - ngx_feature_run=no + ngx_feature_run=yes ngx_feature_incs= ngx_feature_path= ngx_feature_libs= - ngx_feature_test="long n; - __sync_bool_compare_and_swap(&n, 0, 1); - __sync_fetch_and_add(&n, 1);" + ngx_feature_test="long n = 0; + if (!__sync_bool_compare_and_swap(&n, 0, 1)) + return 1; + if (__sync_fetch_and_add(&n, 1) != 1) + return 1; + if (n != 2) + return 1; + __sync_synchronize();" . auto/feature -- cgit