eina: check pending lock at the right time.
authorCedric BAIL <cedric.bail@free.fr>
Mon, 9 May 2011 10:29:55 +0000 (10:29 +0000)
committerCedric BAIL <cedric.bail@free.fr>
Mon, 9 May 2011 10:29:55 +0000 (10:29 +0000)
SVN revision: 59286

legacy/eina/src/lib/eina_main.c

index d39f60b8f2612f9de58d50f4255a3ee346fa0e8f..bb60c19d0f49a33d67c903b2f0e10a73142c6cc8 100644 (file)
@@ -283,7 +283,13 @@ eina_threads_shutdown(void)
 
    assert(pthread_equal(_eina_main_loop, pthread_self()));
    assert(_eina_main_thread_count > 0);
+#endif
+
+   ret = --_eina_main_thread_count;
+   if(_eina_main_thread_count > 0)
+     return ret;
 
+#ifdef EINA_HAVE_DEBUG_THREADS
    pthread_mutex_lock(&_eina_tracking_lock);
    if (_eina_tracking)
      {
@@ -297,13 +303,8 @@ eina_threads_shutdown(void)
        abort();
      }
    pthread_mutex_unlock(&_eina_tracking_lock);
-
 #endif
 
-   ret = --_eina_main_thread_count;
-   if(_eina_main_thread_count > 0)
-     return ret;
-
    eina_share_common_threads_shutdown();
    eina_log_threads_shutdown();