From: Cedric BAIL Date: Thu, 16 Jun 2016 22:14:12 +0000 (-0700) Subject: eio: register one Efl_Io_Manager by default on the main loop at init time. X-Git-Tag: upstream/1.20.0~5564 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b047bf7f641d297a5613e889e83aa5466ec3a575;p=platform%2Fupstream%2Fefl.git eio: register one Efl_Io_Manager by default on the main loop at init time. --- diff --git a/src/lib/eio/eio_main.c b/src/lib/eio/eio_main.c index f10f519..de050f2 100644 --- a/src/lib/eio/eio_main.c +++ b/src/lib/eio/eio_main.c @@ -56,6 +56,7 @@ static Eina_Spinlock memory_pool_lock; static Eina_Lock memory_pool_mutex; static Eina_Condition memory_pool_cond; static Eina_Bool memory_pool_suspended = 1; +static Efl_Io_Manager *io_manager = NULL; static void * _eio_pool_malloc(Eio_Alloc_Pool *pool) @@ -317,9 +318,12 @@ eio_init(void) efreet_mime_init(); + io_manager = eo_add(EFL_IO_MANAGER_CLASS, ecore_main_loop_get()); + efl_loop_register(ecore_main_loop_get(), EFL_IO_MANAGER_CLASS, io_manager); + eina_log_timing(_eio_log_dom_global, - EINA_LOG_STATE_STOP, - EINA_LOG_STATE_INIT); + EINA_LOG_STATE_STOP, + EINA_LOG_STATE_INIT); return _eio_init_count; @@ -353,6 +357,9 @@ eio_shutdown(void) EINA_LOG_STATE_START, EINA_LOG_STATE_SHUTDOWN); + eo_del(io_manager); + io_manager = NULL; + EINA_LIST_FOREACH(tracked_thread, l, f) ecore_thread_cancel(f->thread); diff --git a/src/tests/eio/eio_test_manager.c b/src/tests/eio/eio_test_manager.c index 80ac58d..7bd0015 100644 --- a/src/tests/eio/eio_test_manager.c +++ b/src/tests/eio/eio_test_manager.c @@ -277,10 +277,31 @@ START_TEST(efl_io_manager_test_open) } END_TEST +START_TEST(efl_io_instantiated) +{ + Efl_Io_Manager *manager; + + ecore_init(); + + fail_if(eo_provider_find(ecore_main_loop_get(), EFL_IO_MANAGER_CLASS) != NULL); + + eio_init(); + + manager = eo_provider_find(ecore_main_loop_get(), EFL_IO_MANAGER_CLASS); + fail_if(manager == NULL); + fail_if(!eo_isa(manager, EFL_IO_MANAGER_CLASS)); + + eio_shutdown(); + + ecore_shutdown(); +} +END_TEST + void eio_test_job(TCase *tc) { tcase_add_test(tc, efl_io_manager_test_ls_funcs); tcase_add_test(tc, efl_io_manager_test_file_direct_stat); tcase_add_test(tc, efl_io_manager_test_open); + tcase_add_test(tc, efl_io_instantiated); }