summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-12-06 03:02:47 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-12-06 03:02:47 +0000
commit1a3bb9f0095f69701373e39ee3a39dce90aa6bf5 (patch)
tree5a911c3baa5178c3a7f5989a23da87272fe0a8d0
parent2def8f1f1eb5b8d38cd887a1f488e7a499d549b4 (diff)
efl: revert r80290 as it bork the world.
SVN revision: 80296
-rw-r--r--configure.ac19
-rw-r--r--src/lib/ecore/ecore_private.h7
2 files changed, 26 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 0a6ae71..e0d942f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1965,6 +1965,20 @@ AC_ARG_ENABLE([g-main-loop],
1965 ], 1965 ],
1966 [want_g_main_loop="no"]) 1966 [want_g_main_loop="no"])
1967 1967
1968# thread safety
1969
1970AC_ARG_ENABLE([thread-safety],
1971 [AC_HELP_STRING([--enable-thread-safety],
1972 [enable thread safety. @<:@default=disabled@:>@])],
1973 [
1974 if test "x${enableval}" = "xyes" ; then
1975 want_thread_safety="yes"
1976 else
1977 want_thread_safety="no"
1978 fi
1979 ],
1980 [want_thread_safety="no"])
1981
1968# epoll 1982# epoll
1969 1983
1970AC_ARG_ENABLE([epoll], 1984AC_ARG_ENABLE([epoll],
@@ -1992,6 +2006,10 @@ if test "x${with_glib}" = "xyes" || test "x${with_glib}" = "xalways" ; then
1992 want_glib="yes" 2006 want_glib="yes"
1993fi 2007fi
1994 2008
2009if test "x${want_thread_safety}" = "xyes" ; then
2010 AC_DEFINE([HAVE_THREAD_SAFETY], [1], [Define to enable thread safety])
2011fi
2012
1995want_ecore_timer_dump="no" 2013want_ecore_timer_dump="no"
1996if test "x${build_profile}" = "xdebug" && test "x${ac_cv_func_backtrace}" = "xyes"; then 2014if test "x${build_profile}" = "xdebug" && test "x${ac_cv_func_backtrace}" = "xyes"; then
1997 want_ecore_timer_dump="yes" 2015 want_ecore_timer_dump="yes"
@@ -4130,6 +4148,7 @@ echo " Tiled 32BPP rotate......: $have_tile_rotate"
4130echo 4148echo
4131 4149
4132echo "Ecore:" 4150echo "Ecore:"
4151echo " Thread safety..............: $want_thread_safety"
4133echo " GLib support...............: $with_glib" 4152echo " GLib support...............: $with_glib"
4134echo " Use g_main_loop............: $want_g_main_loop" 4153echo " Use g_main_loop............: $want_g_main_loop"
4135echo " Gathering memory statistic.: $ac_cv_func_mallinfo" 4154echo " Gathering memory statistic.: $ac_cv_func_mallinfo"
diff --git a/src/lib/ecore/ecore_private.h b/src/lib/ecore/ecore_private.h
index 7e7ff3a..f0add82 100644
--- a/src/lib/ecore/ecore_private.h
+++ b/src/lib/ecore/ecore_private.h
@@ -246,7 +246,12 @@ extern Eina_Lock _ecore_main_loop_lock;
246static inline void 246static inline void
247_ecore_lock(void) 247_ecore_lock(void)
248{ 248{
249#ifdef HAVE_THREAD_SAFETY
249 eina_lock_take(&_ecore_main_loop_lock); 250 eina_lock_take(&_ecore_main_loop_lock);
251#else
252 /* at least check we're not being called from a thread */
253 EINA_MAIN_LOOP_CHECK_RETURN;
254#endif
250 _ecore_main_lock_count++; 255 _ecore_main_lock_count++;
251 /* assert(_ecore_main_lock_count == 1); */ 256 /* assert(_ecore_main_lock_count == 1); */
252} 257}
@@ -256,7 +261,9 @@ _ecore_unlock(void)
256{ 261{
257 _ecore_main_lock_count--; 262 _ecore_main_lock_count--;
258 /* assert(_ecore_main_lock_count == 0); */ 263 /* assert(_ecore_main_lock_count == 0); */
264#ifdef HAVE_THREAD_SAFETY
259 eina_lock_release(&_ecore_main_loop_lock); 265 eina_lock_release(&_ecore_main_loop_lock);
266#endif
260} 267}
261 268
262/* 269/*