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:25:52 -0300
commited96f196ebc0860af4552e38b1bb5e738d73ed28 (patch)
tree69b21082e2577fc14c06643d02128bbe1c7e42e6
parentEvas text utils: Fixed walking compound clusters. (diff)
downloadefl-ed96f196ebc0860af4552e38b1bb5e738d73ed28.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 58702060ee..6e35fe6953 100644
--- a/src/lib/ecore/ecore.c
+++ b/src/lib/ecore/ecore.c
@@ -616,9 +616,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);
@@ -1029,7 +1028,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
{