summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2011-09-07 10:16:27 +0000
committerCedric BAIL <cedric.bail@free.fr>2011-09-07 10:16:27 +0000
commita0fab4b871ea6e037fbe0fd8ada735740a0959a3 (patch)
tree3cda65ab8b9c52449b804266652887e5b2139347
parent81ce9220446e5703a8693f416d686bf9fdcd76b0 (diff)
eina: threads debugging back to work.
SVN revision: 63266
-rw-r--r--legacy/eina/src/include/eina_inline_lock_posix.x18
1 files changed, 12 insertions, 6 deletions
diff --git a/legacy/eina/src/include/eina_inline_lock_posix.x b/legacy/eina/src/include/eina_inline_lock_posix.x
index 825edf0ad5..f9a5666e83 100644
--- a/legacy/eina/src/include/eina_inline_lock_posix.x
+++ b/legacy/eina/src/include/eina_inline_lock_posix.x
@@ -102,7 +102,8 @@ eina_lock_new(Eina_Lock *mutex)
102 pthread_mutexattr_t attr; 102 pthread_mutexattr_t attr;
103 103
104#ifdef EINA_HAVE_DEBUG_THREADS 104#ifdef EINA_HAVE_DEBUG_THREADS
105 assert(pthread_equal(_eina_main_loop, pthread_self())); 105 if (!_eina_threads_activated)
106 assert(pthread_equal(_eina_main_loop, pthread_self()));
106#endif 107#endif
107 108
108 if (pthread_mutexattr_init(&attr) != 0) 109 if (pthread_mutexattr_init(&attr) != 0)
@@ -126,7 +127,8 @@ static inline void
126eina_lock_free(Eina_Lock *mutex) 127eina_lock_free(Eina_Lock *mutex)
127{ 128{
128#ifdef EINA_HAVE_DEBUG_THREADS 129#ifdef EINA_HAVE_DEBUG_THREADS
129 assert(pthread_equal(_eina_main_loop, pthread_self())); 130 if (!_eina_threads_activated)
131 assert(pthread_equal(_eina_main_loop, pthread_self()));
130#endif 132#endif
131 133
132 pthread_mutex_destroy(&(mutex->mutex)); 134 pthread_mutex_destroy(&(mutex->mutex));
@@ -283,7 +285,8 @@ eina_condition_new(Eina_Condition *cond, Eina_Lock *mutex)
283{ 285{
284#ifdef EINA_HAVE_DEBUG_THREADS 286#ifdef EINA_HAVE_DEBUG_THREADS
285 assert(mutex != NULL); 287 assert(mutex != NULL);
286 assert(pthread_equal(_eina_main_loop, pthread_self())); 288 if (!_eina_threads_activated)
289 assert(pthread_equal(_eina_main_loop, pthread_self()));
287 memset(cond, 0, sizeof (Eina_Condition)); 290 memset(cond, 0, sizeof (Eina_Condition));
288#endif 291#endif
289 292
@@ -304,7 +307,8 @@ static inline void
304eina_condition_free(Eina_Condition *cond) 307eina_condition_free(Eina_Condition *cond)
305{ 308{
306#ifdef EINA_HAVE_DEBUG_THREADS 309#ifdef EINA_HAVE_DEBUG_THREADS
307 assert(pthread_equal(_eina_main_loop, pthread_self())); 310 if (!_eina_threads_activated)
311 assert(pthread_equal(_eina_main_loop, pthread_self()));
308#endif 312#endif
309 313
310 pthread_cond_destroy(&(cond->condition)); 314 pthread_cond_destroy(&(cond->condition));
@@ -368,7 +372,8 @@ static inline Eina_Bool
368eina_rwlock_new(Eina_RWLock *mutex) 372eina_rwlock_new(Eina_RWLock *mutex)
369{ 373{
370#ifdef EINA_HAVE_DEBUG_THREADS 374#ifdef EINA_HAVE_DEBUG_THREADS
371 assert(pthread_equal(_eina_main_loop, pthread_self())); 375 if (!_eina_threads_activated)
376 assert(pthread_equal(_eina_main_loop, pthread_self()));
372#endif 377#endif
373 378
374 if (pthread_rwlock_init(&(mutex->mutex), NULL) != 0) 379 if (pthread_rwlock_init(&(mutex->mutex), NULL) != 0)
@@ -380,7 +385,8 @@ static inline void
380eina_rwlock_free(Eina_RWLock *mutex) 385eina_rwlock_free(Eina_RWLock *mutex)
381{ 386{
382#ifdef EINA_HAVE_DEBUG_THREADS 387#ifdef EINA_HAVE_DEBUG_THREADS
383 assert(pthread_equal(_eina_main_loop, pthread_self())); 388 if (!_eina_threads_activated)
389 assert(pthread_equal(_eina_main_loop, pthread_self()));
384#endif 390#endif
385 391
386 pthread_rwlock_destroy(&(mutex->mutex)); 392 pthread_rwlock_destroy(&(mutex->mutex));