You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2010/01/25 15:46:32 UTC
svn commit: r902829 - /lucene/lucy/trunk/core/Lucy/Util/Atomic.bp
Author: marvin
Date: Mon Jan 25 14:46:32 2010
New Revision: 902829
URL: http://svn.apache.org/viewvc?rev=902829&view=rev
Log:
Fall back to pthread-based atomic simulation instead of using GCC intrinsics.
Use the presence of windows.h rather than intrin.h to test for Windows
atomics, since intrin.h is C++ linkage only.
Modified:
lucene/lucy/trunk/core/Lucy/Util/Atomic.bp
Modified: lucene/lucy/trunk/core/Lucy/Util/Atomic.bp
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Util/Atomic.bp?rev=902829&r1=902828&r2=902829&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Util/Atomic.bp (original)
+++ lucene/lucy/trunk/core/Lucy/Util/Atomic.bp Mon Jan 25 14:46:32 2010
@@ -24,7 +24,7 @@
}
/********************************** Windows *******************************/
-#elif defined(CHY_HAS_INTRIN_H)
+#elif defined(CHY_HAS_WINDOWS_H)
chy_bool_t
lucy_Atomic_wrapped_cas_ptr(void *volatile *target, void *old_value,
@@ -46,16 +46,6 @@
return atomic_cas_ptr(target, old_value, new_value) == old_value;
}
-/**************************** GCC 4.1.0 and later *************************/
-#elif (defined(__GNUC__) \
- && (__GNUC__ * 100000 + __GNUC_MINOR__ * 1000 >= 401000))
-
-static CHY_INLINE chy_bool_t
-lucy_Atomic_cas_ptr(void *volatile *target, void *old_value, void *new_value)
-{
- return __sync_bool_compare_and_swap(target, old_value, new_value);
-}
-
/************************ Fall back to pthread.h. **************************/
#elif defined(CHY_HAS_PTHREAD_H)
#include <pthread.h>