summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-08-19 20:21:02 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-08-19 20:22:57 +0200
commitc11f40a3eb1d4a03853986e7ac64a54bd2ac3861 (patch)
tree6d5d4c87eaaee96f5546d6658c27adb142b0edee
parenta197aa366be10c57fcbc037d86f4a0310486375b (diff)
eio: limit race condition during shutdown.
-rw-r--r--src/lib/eio/eio_monitor_poll.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/eio/eio_monitor_poll.c b/src/lib/eio/eio_monitor_poll.c
index 0e222f5bc8..cb9daf9895 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)
329 329
330 if (!backend) return; 330 if (!backend) return;
331 331
332 backend->parent = NULL; 332 if (backend->work) ecore_thread_cancel(backend->work);
333
333 if (backend->timer) ecore_timer_del(backend->timer); 334 if (backend->timer) ecore_timer_del(backend->timer);
334 backend->timer = NULL; 335 backend->timer = NULL;
335 if (backend->idler) ecore_idler_del(backend->idler); 336 if (backend->idler) ecore_idler_del(backend->idler);
336 backend->idler = NULL; 337 backend->idler = NULL;
337 if (backend->work) 338
339 if (backend->work && !ecore_thread_wait(backend->work, 0.3))
338 { 340 {
339 backend->delete_me = EINA_TRUE; 341 backend->delete_me = EINA_TRUE;
340 ecore_thread_cancel(backend->work);
341 return; 342 return;
342 } 343 }
344
345 backend->parent = NULL;
343 eina_hash_free(backend->children); 346 eina_hash_free(backend->children);
344 free(backend); 347 free(backend);
345} 348}