From: caro Date: Sat, 10 Oct 2009 03:24:56 +0000 (+0000) Subject: no need for ref count in ecore_thread init/shutdown functions X-Git-Tag: build/2012-07-04.173327~2438 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=06b179ea59bb3e6f56bd8d6b088dcc5ab5c7065e;p=profile%2Fivi%2Fecore.git no need for ref count in ecore_thread init/shutdown functions git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@42991 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/ecore/ecore_private.h b/src/lib/ecore/ecore_private.h index 08edd88..6ab38e5 100644 --- a/src/lib/ecore/ecore_private.h +++ b/src/lib/ecore/ecore_private.h @@ -444,8 +444,8 @@ void _ecore_fps_debug_init(void); void _ecore_fps_debug_shutdown(void); void _ecore_fps_debug_runtime_add(double t); -int _ecore_thread_init(void); -int _ecore_thread_shutdown(void); +void _ecore_thread_init(void); +void _ecore_thread_shutdown(void); void _ecore_glib_init(void); void _ecore_glib_shutdown(void); diff --git a/src/lib/ecore/ecore_thread.c b/src/lib/ecore/ecore_thread.c index 9006cf2..9ce04b9 100644 --- a/src/lib/ecore/ecore_thread.c +++ b/src/lib/ecore/ecore_thread.c @@ -27,7 +27,6 @@ struct _Ecore_Pthread_Worker static int _ecore_thread_count_max = 0; static int _ecore_thread_count = 0; -static int _ecore_thread_initcount = 0; static Eina_List *_ecore_thread = NULL; static int ECORE_THREAD_PIPE_DEL = 0; static Ecore_Event_Handler *del_handler = NULL; @@ -133,13 +132,9 @@ _ecore_thread_handler(void *data __UNUSED__, void *buffer, unsigned int nbyte) } #endif -int +void _ecore_thread_init(void) { - _ecore_thread_initcount++; - - if (_ecore_thread_initcount > 1) return _ecore_thread_initcount; - _ecore_thread_count_max = eina_cpu_count(); if (_ecore_thread_count_max <= 0) _ecore_thread_count_max = 1; @@ -148,24 +143,16 @@ _ecore_thread_init(void) #ifdef BUILD_PTHREAD del_handler = ecore_event_handler_add(ECORE_THREAD_PIPE_DEL, _ecore_thread_pipe_del, NULL); #endif - return _ecore_thread_initcount; } -int +void _ecore_thread_shutdown(void) { - _ecore_thread_initcount--; - - if (!_ecore_thread_initcount) - { - /* FIXME: If function are still running in the background, should we kill them ? */ + /* FIXME: If function are still running in the background, should we kill them ? */ #ifdef BUILD_PTHREAD - ecore_event_handler_del(del_handler); - del_handler = NULL; + ecore_event_handler_del(del_handler); + del_handler = NULL; #endif - } - - return _ecore_thread_initcount; } /*