no need for ref count in ecore_thread init/shutdown functions
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 10 Oct 2009 03:24:56 +0000 (03:24 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 10 Oct 2009 03:24:56 +0000 (03:24 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@42991 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore/ecore_private.h
src/lib/ecore/ecore_thread.c

index 08edd88..6ab38e5 100644 (file)
@@ -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);
index 9006cf2..9ce04b9 100644 (file)
@@ -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;
 }
 
 /*