aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore/ecore.c
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:24:28 -0300
commit30d7779178d8b961004dabae6b0ed682f6889e97 (patch)
tree711e4e16a13491499947d5326f0f44bd55bce1e8 /src/lib/ecore/ecore.c
parentRevert "evas example: fix warning in compilation of evas-box.c." (diff)
downloadefl-30d7779178d8b961004dabae6b0ed682f6889e97.tar.gz
ecore: @fix race condition when using ecore_main_loop_thread_safe_call_sync.
Diffstat (limited to 'src/lib/ecore/ecore.c')
-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
{