cedric pushed a commit to branch master.

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

commit c11f40a3eb1d4a03853986e7ac64a54bd2ac3861
Author: Cedric BAIL <ced...@osg.samsung.com>
Date:   Wed Aug 19 20:21:02 2015 +0200

    eio: limit race condition during shutdown.
---
 src/lib/eio/eio_monitor_poll.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/lib/eio/eio_monitor_poll.c b/src/lib/eio/eio_monitor_poll.c
index 0e222f5..cb9daf9 100644
--- a/src/lib/eio/eio_monitor_poll.c
+++ b/src/lib/eio/eio_monitor_poll.c
@@ -329,17 +329,20 @@ eio_monitor_fallback_del(Eio_Monitor *monitor)
 
    if (!backend) return;
 
-   backend->parent = NULL;
+   if (backend->work) ecore_thread_cancel(backend->work);
+
    if (backend->timer) ecore_timer_del(backend->timer);
    backend->timer = NULL;
    if (backend->idler) ecore_idler_del(backend->idler);
    backend->idler = NULL;
-   if (backend->work)
+
+   if (backend->work && !ecore_thread_wait(backend->work, 0.3))
      {
         backend->delete_me = EINA_TRUE;
-        ecore_thread_cancel(backend->work);
         return;
      }
+
+   backend->parent = NULL;
    eina_hash_free(backend->children);
    free(backend);
 }

-- 


Reply via email to