eina: remove useless lock.

SVN revision: 59233
This commit is contained in:
Cedric BAIL 2011-05-06 09:07:26 +00:00
parent ba96d1220f
commit b4f8d80b02
1 changed files with 2 additions and 20 deletions

View File

@ -83,8 +83,6 @@ EAPI pthread_mutex_t _eina_tracking_lock;
EAPI Eina_Inlist *_eina_tracking = NULL; EAPI Eina_Inlist *_eina_tracking = NULL;
#endif #endif
static Eina_Lock _mutex;
/* place module init/shutdown functions here to avoid other modules /* place module init/shutdown functions here to avoid other modules
* calling them by mistake. * calling them by mistake.
*/ */
@ -227,8 +225,6 @@ eina_init(void)
} }
} }
eina_lock_new(&_mutex);
_eina_main_count = 1; _eina_main_count = 1;
return 1; return 1;
} }
@ -244,8 +240,6 @@ eina_shutdown(void)
#ifdef EINA_HAVE_DEBUG_THREADS #ifdef EINA_HAVE_DEBUG_THREADS
pthread_mutex_destroy(&_eina_tracking_lock); pthread_mutex_destroy(&_eina_tracking_lock);
#endif #endif
eina_lock_free(&_mutex);
} }
return _eina_main_count; return _eina_main_count;
@ -262,22 +256,16 @@ eina_threads_init(void)
assert(pthread_equal(_eina_main_loop, pthread_self())); assert(pthread_equal(_eina_main_loop, pthread_self()));
#endif #endif
eina_lock_take(&_mutex);
++_eina_main_thread_count; ++_eina_main_thread_count;
ret = _eina_main_thread_count; ret = _eina_main_thread_count;
if(_eina_main_thread_count > 1) if(_eina_main_thread_count > 1)
{ return ret;
eina_lock_release(&_mutex);
return ret;
}
eina_share_common_threads_init(); eina_share_common_threads_init();
eina_log_threads_init(); eina_log_threads_init();
_eina_threads_activated = EINA_TRUE; _eina_threads_activated = EINA_TRUE;
eina_lock_release(&_mutex);
return ret; return ret;
#else #else
return 0; return 0;
@ -312,19 +300,13 @@ eina_threads_shutdown(void)
#endif #endif
eina_lock_take(&_mutex);
ret = --_eina_main_thread_count; ret = --_eina_main_thread_count;
if(_eina_main_thread_count > 0) if(_eina_main_thread_count > 0)
{ return ret;
eina_lock_release(&_mutex);
return ret;
}
eina_share_common_threads_shutdown(); eina_share_common_threads_shutdown();
eina_log_threads_shutdown(); eina_log_threads_shutdown();
eina_lock_release(&_mutex);
_eina_threads_activated = EINA_FALSE; _eina_threads_activated = EINA_FALSE;
return ret; return ret;