cedric pushed a commit to branch efl-1.9.

http://git.enlightenment.org/core/efl.git/commit/?id=776c0664d487520b08c3768321f19bfe580f8966

commit 776c0664d487520b08c3768321f19bfe580f8966
Author: Cedric Bail <[email protected]>
Date:   Thu Feb 27 12:24:28 2014 -0300

    ecore: @fix race condition when using ecore_main_loop_thread_safe_call_sync.
---
 src/lib/ecore/ecore.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c
index 6356b2f..0468c92 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
           {

-- 


Reply via email to