use new spinlock detection
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 25 Dec 2009 11:30:41 +0000 (11:30 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 25 Dec 2009 11:30:41 +0000 (11:30 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@44718 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

configure.ac
src/lib/eina_log.c

index 5df8242..f077927 100644 (file)
@@ -50,14 +50,11 @@ EFL_CHECK_CPU_SSE([have_sse="yes"], [have_sse="no"])
 EFL_CHECK_CPU_SSE2([have_sse2="yes"], [have_sse2="no"])
 EFL_CHECK_CPU_ALTIVEC([have_altivec="yes"], [have_altivec="no"])
 
-EFL_CHECK_PTHREAD([have_pthread="yes"], [have_pthread="no"])
-
-if test "x${have_pthread}" = "xyes"; then
-   AC_CHECK_LIB(pthread, pthread_spin_init,
-               [
-                 AC_DEFINE(EINA_PTHREAD_SPIN, 1, [Build eina_log lock using pthread_spin])
-               ])
-fi
+EFL_CHECK_PTHREAD(["yes"],
+   [have_pthread="yes"],
+   [have_pthread="no"],
+   [have_pthread_spinlock="yes"],
+   [have_pthread_spinlock="no"])
 
 ### Additional options to configure
 
@@ -479,7 +476,7 @@ echo "  Safety checks........: ${have_safety_checks}"
 echo "  Maximum log level....: ${with_max_log_level}"
 echo "  Report string usage..: ${have_stringshare_usage}"
 echo "  Default mempool......: ${have_default_mempool}"
-echo "  Thread Support.......: ${have_pthread}"
+echo "  Thread Support.......: ${have_pthread} (spinlock: ${have_pthread_spinlock})"
 echo "  Amalgamation.........: ${do_amalgamation}"
 echo
 echo "  Documentation........: ${build_doc}"
index 1b90bb1..d1e93c3 100644 (file)
@@ -375,7 +375,7 @@ static pthread_t _main_thread;
      }                                                                 \
   } while (0)
 
-#ifdef EINA_PTHREAD_SPIN
+#ifdef EFL_HAVE_PTHREAD_SPINLOCK
 static pthread_spinlock_t _log_lock;
 #define LOG_LOCK()                                                             \
   if(_threads_enabled) \