AC_SUBST(EINA_CONFIGURE_HAVE_DEBUG_THREADS)
AM_CONDITIONAL([EINA_DEBUG_THREADS], [! test "x${have_debug_threads}" = "xno"])
+if ! test "x${have_on_off_threads}" = "xno"; then
+ EINA_CONFIGURE_HAVE_ON_OFF_THREADS="#define EINA_ON_OFF_THREADS"
+fi
+AC_SUBST(EINA_CONFIGURE_HAVE_ON_OFF_THREADS)
+AM_CONDITIONAL([EINA_ON_OFF_THREADS], [! test "x${have_on_off_threads}" = "xno"])
+
### Additional options to configure
# Magic debug
if test "${have_threads}" = "POSIX" ; then
echo " spinlock...........: ${have_posix_threads_spinlock}"
echo " debug usage........: ${have_debug_threads}"
+echo " on/off support.....: ${have_on_off_threads}"
fi
echo " Amalgamation.........: ${do_amalgamation}"
echo " Iconv support........: ${have_iconv}"
AC_SUBST(EFL_PTHREAD_CFLAGS)
AC_SUBST(EFL_PTHREAD_LIBS)
+_efl_enable_on_off_threads="no"
+AC_ARG_ENABLE([on-off-threads],
+ [AC_HELP_STRING([--enable-on-off-threads], [only turn this on if you know what you are doing, and don't complain if the world freeze])],
+ [_efl_enable_on_off_threads="${enableval}"])
+
+have_on_off_threads="no"
+if test "x${_efl_enable_on_off_threads}" = "xyes"; then
+ have_on_off_threads="yes"
+ AC_DEFINE([EFL_ON_OFF_THREADS], [1], [make it possible to disable all locks])
+fi
+AC_MSG_CHECKING([whether to turn on/off threads lock on demand])
+AC_MSG_RESULT([${_efl_enable_on_off_threads}])
+
_efl_enable_debug_threads="no"
AC_ARG_ENABLE([debug-threads],
[AC_HELP_STRING([--enable-debug-threads], [disable assert when you forgot to call eina_threads_init])],
[have_voltron="no"]
)
- if test "x$have_voltron" = "xyes" -a "x$do_amalgamation" = "xyes";then
+ if test "x$have_voltron" = "xyes" -a "x$do_amalgamation" = "xyes" -o "x${have_on_off_threads}" = "xyes"; then
echo "//////////////////////////////////////////////////////////////////////////////////////////////////////////////////"
echo "/////////////////////////////////////////////////////////////////////////////////////{#///////////////////////////"
echo "/////////////////////////////////////////////////////////////////////////////////// EN3 xx&HWx////////////////////"
#endif
#define EINA_SIZEOF_WCHAR_T @EINA_SIZEOF_WCHAR_T@
+#ifdef EINA_HAVE_ON_OFF_THREADS
+# undef EINA_HAVE_ON_OFF_THREADS
+#endif
+@EINA_CONFIGURE_HAVE_ON_OFF_THREADS@
+
#endif /* EINA_CONFIG_H_ */
static inline Eina_Lock_Result
eina_lock_take(Eina_Lock *mutex)
{
- Eina_Bool ret = EINA_FALSE;
+ Eina_Lock_Result ret = EINA_FALSE;
int ok;
+#ifdef EINA_HAVE_ON_OFF_THREADS
+ if (!_eina_threads_activated)
+ {
#ifdef EINA_HAVE_DEBUG_THREADS
- if (_eina_threads_activated)
- assert(pthread_equal(_eina_main_loop, pthread_self()));
+ assert(pthread_equal(_eina_main_loop, pthread_self()));
+#endif
+ return EINA_FALSE;
+ }
+#endif
+#ifdef EINA_HAVE_DEBUG_THREADS
if (_eina_threads_debug)
{
struct timeval t0, t1;
static inline Eina_Lock_Result
eina_lock_take_try(Eina_Lock *mutex)
{
- Eina_Bool ret = EINA_FALSE;
+ Eina_Lock_Result ret = EINA_FALSE;
int ok;
+#ifdef EINA_HAVE_ON_OFF_THREADS
+ if (!_eina_threads_activated)
+ {
+#ifdef EINA_HAVE_DEBUG_THREADS
+ assert(pthread_equal(_eina_main_loop, pthread_self()));
+#endif
+ return EINA_FALSE;
+ }
+#endif
+
#ifdef EINA_HAVE_DEBUG_THREADS
- if (_eina_threads_activated)
+ if (!_eina_threads_activated)
assert(pthread_equal(_eina_main_loop, pthread_self()));
#endif
static inline Eina_Lock_Result
eina_lock_release(Eina_Lock *mutex)
{
- Eina_Bool ret;
+ Eina_Lock_Result ret;
+#ifdef EINA_HAVE_ON_OFF_THREADS
+ if (!_eina_threads_activated)
+ {
#ifdef EINA_HAVE_DEBUG_THREADS
- if (_eina_threads_activated)
- assert(pthread_equal(_eina_main_loop, pthread_self()));
+ assert(pthread_equal(_eina_main_loop, pthread_self()));
+#endif
+ return EINA_FALSE;
+ }
#endif
#ifdef EINA_HAVE_DEBUG_THREADS