With -DDEBUG, we can see an error message, like:
ERR: You are calling _ecore_lock() from outside of the main loop
threads in lib/ecore/ecore_private at line 306
Looking at the code shows that ecore_lock fails immediately if
thread debugging is enabled, but ecore_unlock does not, so the
value _ecore_main_lock_count could go below 0.
This is not very important as the value is never used.
static inline void
_ecore_unlock(void)
{
+#ifndef HAVE_THREAD_SAFETY
+ /* see _ecore_lock(); no-op unless EINA_HAVE_DEBUG_THREADS is defined */
+ EINA_MAIN_LOOP_CHECK_RETURN;
+#endif
_ecore_main_lock_count--;
/* assert(_ecore_main_lock_count == 0); */
#ifdef HAVE_THREAD_SAFETY