summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore/ecore.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-08-09 10:52:48 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-08-09 10:52:48 +0000
commite905f3ccd2b684b41834e7bdc916679ea5af77b1 (patch)
treea2c1b9683a08cf6635d0e33c42a822169f4aae97 /legacy/ecore/src/lib/ecore/ecore.c
parenta5e2b68c698fd46298c21e213f5e1481375302a6 (diff)
ecore: correctly shutdown Ecore_Thread.
SVN revision: 75039
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore/ecore.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/legacy/ecore/src/lib/ecore/ecore.c b/legacy/ecore/src/lib/ecore/ecore.c
index c5aeb83b9f..b7e47dc2b2 100644
--- a/legacy/ecore/src/lib/ecore/ecore.c
+++ b/legacy/ecore/src/lib/ecore/ecore.c
@@ -224,6 +224,7 @@ shutdown_evil:
224EAPI int 224EAPI int
225ecore_shutdown(void) 225ecore_shutdown(void)
226{ 226{
227 Ecore_Pipe *p;
227 /* 228 /*
228 * take a lock here because _ecore_event_shutdown() does callbacks 229 * take a lock here because _ecore_event_shutdown() does callbacks
229 */ 230 */
@@ -237,6 +238,13 @@ ecore_shutdown(void)
237 if (--_ecore_init_count != 0) 238 if (--_ecore_init_count != 0)
238 goto unlock; 239 goto unlock;
239 240
241 if (_ecore_fps_debug) _ecore_fps_debug_shutdown();
242 _ecore_poller_shutdown();
243 _ecore_animator_shutdown();
244 _ecore_glib_shutdown();
245 _ecore_job_shutdown();
246 _ecore_thread_shutdown();
247
240 /* this looks horrible - a hack for now, but something to note. as 248 /* this looks horrible - a hack for now, but something to note. as
241 * we delete the _thread_call pipe a thread COULD be doing 249 * we delete the _thread_call pipe a thread COULD be doing
242 * ecore_pipe_write() or what not to it at the same time - we 250 * ecore_pipe_write() or what not to it at the same time - we
@@ -246,25 +254,23 @@ ecore_shutdown(void)
246 * ok - this causes other valgrind complaints regarding glib aquiring 254 * ok - this causes other valgrind complaints regarding glib aquiring
247 * locks internally. so fix bug a or bug b. let's leave the original 255 * locks internally. so fix bug a or bug b. let's leave the original
248 * bug in then and leave this as a note for now 256 * bug in then and leave this as a note for now
249 Ecore_Pipe *p; 257 */
258 /*
259 * It should be fine now as we do wait for thread to shutdown before
260 * we try to destroy the pipe.
261 */
250 p = _thread_call; 262 p = _thread_call;
251 _thread_call = NULL; 263 _thread_call = NULL;
252 ecore_pipe_wait(p, 1, 0.1); 264 ecore_pipe_wait(p, 1, 0.1);
253 ecore_pipe_del(p); 265 ecore_pipe_del(p);
254 eina_lock_free(&_thread_safety); 266 eina_lock_free(&_thread_safety);
255 */
256 eina_condition_free(&_thread_cond); 267 eina_condition_free(&_thread_cond);
257 eina_lock_free(&_thread_mutex); 268 eina_lock_free(&_thread_mutex);
258 eina_condition_free(&_thread_feedback_cond); 269 eina_condition_free(&_thread_feedback_cond);
259 eina_lock_free(&_thread_feedback_mutex); 270 eina_lock_free(&_thread_feedback_mutex);
260 eina_lock_free(&_thread_id_lock); 271 eina_lock_free(&_thread_id_lock);
261 272
262 if (_ecore_fps_debug) _ecore_fps_debug_shutdown(); 273
263 _ecore_poller_shutdown();
264 _ecore_animator_shutdown();
265 _ecore_glib_shutdown();
266 _ecore_job_shutdown();
267 _ecore_thread_shutdown();
268#ifndef HAVE_EXOTIC 274#ifndef HAVE_EXOTIC
269 _ecore_exe_shutdown(); 275 _ecore_exe_shutdown();
270#endif 276#endif