From 741e6d93a088bcea6aefe10b5ece5535fdf0f0d4 Mon Sep 17 00:00:00 2001 From: cedric Date: Fri, 6 May 2011 09:07:26 +0000 Subject: [PATCH] eina: remove useless lock. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@59233 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/eina_main.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/lib/eina_main.c b/src/lib/eina_main.c index 6f2f7c5..d39f60b 100644 --- a/src/lib/eina_main.c +++ b/src/lib/eina_main.c @@ -83,8 +83,6 @@ EAPI pthread_mutex_t _eina_tracking_lock; EAPI Eina_Inlist *_eina_tracking = NULL; #endif -static Eina_Lock _mutex; - /* place module init/shutdown functions here to avoid other modules * calling them by mistake. */ @@ -227,8 +225,6 @@ eina_init(void) } } - eina_lock_new(&_mutex); - _eina_main_count = 1; return 1; } @@ -244,8 +240,6 @@ eina_shutdown(void) #ifdef EINA_HAVE_DEBUG_THREADS pthread_mutex_destroy(&_eina_tracking_lock); #endif - - eina_lock_free(&_mutex); } return _eina_main_count; @@ -262,22 +256,16 @@ eina_threads_init(void) assert(pthread_equal(_eina_main_loop, pthread_self())); #endif - eina_lock_take(&_mutex); ++_eina_main_thread_count; ret = _eina_main_thread_count; if(_eina_main_thread_count > 1) - { - eina_lock_release(&_mutex); - return ret; - } + return ret; eina_share_common_threads_init(); eina_log_threads_init(); _eina_threads_activated = EINA_TRUE; - eina_lock_release(&_mutex); - return ret; #else return 0; @@ -312,19 +300,13 @@ eina_threads_shutdown(void) #endif - eina_lock_take(&_mutex); ret = --_eina_main_thread_count; if(_eina_main_thread_count > 0) - { - eina_lock_release(&_mutex); - return ret; - } + return ret; eina_share_common_threads_shutdown(); eina_log_threads_shutdown(); - eina_lock_release(&_mutex); - _eina_threads_activated = EINA_FALSE; return ret; -- 2.7.4