forked from enlightenment/efl
efl: thread safety by default.
it's better to test this case and make it the only one and make it work, than have two options that may not work. SVN revision: 80290
This commit is contained in:
parent
d69c4b6208
commit
2731721d50
19
configure.ac
19
configure.ac
|
@ -1953,20 +1953,6 @@ AC_ARG_ENABLE([g-main-loop],
|
||||||
],
|
],
|
||||||
[want_g_main_loop="no"])
|
[want_g_main_loop="no"])
|
||||||
|
|
||||||
# thread safety
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([thread-safety],
|
|
||||||
[AC_HELP_STRING([--enable-thread-safety],
|
|
||||||
[enable thread safety. @<:@default=disabled@:>@])],
|
|
||||||
[
|
|
||||||
if test "x${enableval}" = "xyes" ; then
|
|
||||||
want_thread_safety="yes"
|
|
||||||
else
|
|
||||||
want_thread_safety="no"
|
|
||||||
fi
|
|
||||||
],
|
|
||||||
[want_thread_safety="no"])
|
|
||||||
|
|
||||||
# epoll
|
# epoll
|
||||||
|
|
||||||
AC_ARG_ENABLE([epoll],
|
AC_ARG_ENABLE([epoll],
|
||||||
|
@ -1994,10 +1980,6 @@ if test "x${with_glib}" = "xyes" || test "x${with_glib}" = "xalways" ; then
|
||||||
want_glib="yes"
|
want_glib="yes"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x${want_thread_safety}" = "xyes" ; then
|
|
||||||
AC_DEFINE([HAVE_THREAD_SAFETY], [1], [Define to enable thread safety])
|
|
||||||
fi
|
|
||||||
|
|
||||||
want_ecore_timer_dump="no"
|
want_ecore_timer_dump="no"
|
||||||
if test "x${build_profile}" = "xdebug" && test "x${ac_cv_func_backtrace}" = "xyes"; then
|
if test "x${build_profile}" = "xdebug" && test "x${ac_cv_func_backtrace}" = "xyes"; then
|
||||||
want_ecore_timer_dump="yes"
|
want_ecore_timer_dump="yes"
|
||||||
|
@ -4184,7 +4166,6 @@ echo " Tiled 32BPP rotate......: $have_tile_rotate"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo "Ecore:"
|
echo "Ecore:"
|
||||||
echo " Thread safety..............: $want_thread_safety"
|
|
||||||
echo " GLib support...............: $with_glib"
|
echo " GLib support...............: $with_glib"
|
||||||
echo " Use g_main_loop............: $want_g_main_loop"
|
echo " Use g_main_loop............: $want_g_main_loop"
|
||||||
echo " Gathering memory statistic.: $ac_cv_func_mallinfo"
|
echo " Gathering memory statistic.: $ac_cv_func_mallinfo"
|
||||||
|
|
|
@ -246,12 +246,7 @@ extern Eina_Lock _ecore_main_loop_lock;
|
||||||
static inline void
|
static inline void
|
||||||
_ecore_lock(void)
|
_ecore_lock(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_THREAD_SAFETY
|
|
||||||
eina_lock_take(&_ecore_main_loop_lock);
|
eina_lock_take(&_ecore_main_loop_lock);
|
||||||
#else
|
|
||||||
/* at least check we're not being called from a thread */
|
|
||||||
EINA_MAIN_LOOP_CHECK_RETURN;
|
|
||||||
#endif
|
|
||||||
_ecore_main_lock_count++;
|
_ecore_main_lock_count++;
|
||||||
/* assert(_ecore_main_lock_count == 1); */
|
/* assert(_ecore_main_lock_count == 1); */
|
||||||
}
|
}
|
||||||
|
@ -261,9 +256,7 @@ _ecore_unlock(void)
|
||||||
{
|
{
|
||||||
_ecore_main_lock_count--;
|
_ecore_main_lock_count--;
|
||||||
/* assert(_ecore_main_lock_count == 0); */
|
/* assert(_ecore_main_lock_count == 0); */
|
||||||
#ifdef HAVE_THREAD_SAFETY
|
|
||||||
eina_lock_release(&_ecore_main_loop_lock);
|
eina_lock_release(&_ecore_main_loop_lock);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue