aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@free.fr>2014-02-27 12:24:28 -0300
committerCedric Bail <cedric.bail@free.fr>2014-02-27 12:26:21 -0300
commit776c0664d487520b08c3768321f19bfe580f8966 (patch)
treef75271726c7a5958e6588e55df25f6259d387f9d
parentedje: Fix CURRENT option works. (diff)
downloadefl-776c0664d487520b08c3768321f19bfe580f8966.tar.gz
ecore: @fix race condition when using ecore_main_loop_thread_safe_call_sync.
-rw-r--r--src/lib/ecore/ecore.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c
index 6356b2f12d..0468c92311 100644
--- a/src/lib/ecore/ecore.c
+++ b/src/lib/ecore/ecore.c
@@ -610,9 +610,8 @@ ecore_main_loop_thread_safe_call_sync(Ecore_Data_Cb callback,
order->sync = EINA_TRUE;
order->suspend = EINA_FALSE;
- _ecore_main_loop_thread_safe_call(order);
-
eina_lock_take(&order->m);
+ _ecore_main_loop_thread_safe_call(order);
eina_condition_wait(&order->c);
eina_lock_release(&order->m);
@@ -1023,7 +1022,9 @@ _ecore_main_call_flush(void)
else if (call->sync)
{
call->data = call->cb.sync(call->data);
+ eina_lock_take(&call->m);
eina_condition_broadcast(&call->c);
+ eina_lock_release(&call->m);
}
else
{