eina_lock_free(&call->m);
}
-static void
-_thread_callback(void *data __UNUSED__,
- void *buffer __UNUSED__,
- unsigned int nbyte __UNUSED__)
+void
+_ecore_main_call_flush(void)
{
Ecore_Safe_Call *call;
Eina_List *callback;
}
}
+static void
+_thread_callback(void *data __UNUSED__,
+ void *buffer __UNUSED__,
+ unsigned int nbyte __UNUSED__)
+{
+ _ecore_main_call_flush();
+}
+
const void *data;
- volatile int cancel;
+ int cancel;
#ifdef EFL_HAVE_THREADS
LK(cancel_mutex);
static void
_ecore_thread_join(PH(thread))
{
- PHJ(thread);
+ PHJ(thread);
}
static void
const void *data)
{
Ecore_Pthread_Worker *work;
+ Eina_Bool tried = EINA_FALSE;
#ifdef EFL_HAVE_THREADS
PH(thread);
#endif
LKL(_ecore_pending_job_threads_mutex);
+ retry:
if (PHC(thread, _ecore_thread_worker, NULL) == 0)
{
_ecore_thread_count++;
LKU(_ecore_pending_job_threads_mutex);
return (Ecore_Thread *)work;
}
- LKU(_ecore_pending_job_threads_mutex);
-
- eina_threads_shutdown();
+ if (!tried)
+ {
+ _ecore_main_call_flush();
+ tried = EINA_TRUE;
+ goto retry;
+ }
- LKL(_ecore_pending_job_threads_mutex);
if (_ecore_thread_count == 0)
{
_ecore_pending_job_threads = eina_list_remove(_ecore_pending_job_threads, work);
work = NULL;
}
LKU(_ecore_pending_job_threads_mutex);
+
+ eina_threads_shutdown();
+
return (Ecore_Thread *)work;
#else
/*
{
#ifdef EFL_HAVE_THREADS
Ecore_Pthread_Worker *worker;
+ Eina_Bool tried = EINA_FALSE;
PH(thread);
EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
eina_threads_init();
+ retry_direct:
if (PHC(t, _ecore_direct_worker, worker) == 0)
return (Ecore_Thread *)worker;
+ if (!tried)
+ {
+ _ecore_main_call_flush();
+ tried = EINA_TRUE;
+ goto retry_direct;
+ }
if (worker->u.feedback_run.direct_worker)
{
eina_threads_init();
LKL(_ecore_pending_job_threads_mutex);
+ retry:
if (PHC(thread, _ecore_thread_worker, NULL) == 0)
{
_ecore_thread_count++;
LKU(_ecore_pending_job_threads_mutex);
return (Ecore_Thread *)worker;
}
+ if (!tried)
+ {
+ _ecore_main_call_flush();
+ tried = EINA_TRUE;
+ goto retry;
+ }
LKU(_ecore_pending_job_threads_mutex);
eina_threads_shutdown();