From c432e725824c749af5ac6f437fcc94becc9a597f Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Wed, 10 Oct 2012 21:48:34 +0000 Subject: [PATCH] efl: unify EFL_DEBUG_THREADS and EINA_HAVE_DEBUG_THREADS SVN revision: 77821 --- configure.ac | 1 - .../eina/mp/chained_pool/eina_chained_mempool.c | 15 ++++++++------- src/modules/eina/mp/one_big/eina_one_big.c | 11 ++++++----- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index 1fe801a1e3..783ec48083 100644 --- a/configure.ac +++ b/configure.ac @@ -516,7 +516,6 @@ EFL_CHECK_THREADS if test "$want_debug_threads" = "yes"; then EINA_CONFIGURE_HAVE_DEBUG_THREADS="#define EINA_HAVE_DEBUG_THREADS" - AC_DEFINE([EFL_DEBUG_THREADS], [1], [Assert when forgot to call eina_threads_init]) fi AC_SUBST(EINA_CONFIGURE_HAVE_DEBUG_THREADS) diff --git a/src/modules/eina/mp/chained_pool/eina_chained_mempool.c b/src/modules/eina/mp/chained_pool/eina_chained_mempool.c index c3985c2d68..8ed2b42214 100644 --- a/src/modules/eina/mp/chained_pool/eina_chained_mempool.c +++ b/src/modules/eina/mp/chained_pool/eina_chained_mempool.c @@ -26,7 +26,7 @@ #ifdef EFL_HAVE_POSIX_THREADS #include -# ifdef EFL_DEBUG_THREADS +# ifdef EINA_HAVE_DEBUG_THREADS # include # endif #endif @@ -41,6 +41,7 @@ # undef WIN32_LEAN_AND_MEAN #endif +#include "eina_config.h" #include "eina_inlist.h" #include "eina_error.h" #include "eina_module.h" @@ -81,7 +82,7 @@ struct _Chained_Mempool #ifdef EINA_DEBUG_MALLOC int minimal_size; #endif -#ifdef EFL_DEBUG_THREADS +#ifdef EINA_HAVE_DEBUG_THREADS pthread_t self; #endif Eina_Lock mutex; @@ -264,7 +265,7 @@ eina_chained_mempool_malloc(void *data, EINA_UNUSED unsigned int size) if (!eina_lock_take(&pool->mutex)) { -#ifdef EFL_DEBUG_THREADS +#ifdef EINA_HAVE_DEBUG_THREADS assert(pthread_equal(pool->self, pthread_self())); #endif } @@ -314,7 +315,7 @@ eina_chained_mempool_free(void *data, void *ptr) // look 4 pool if (!eina_lock_take(&pool->mutex)) { -#ifdef EFL_DEBUG_THREADS +#ifdef EINA_HAVE_DEBUG_THREADS assert(pthread_equal(pool->self, pthread_self())); #endif } @@ -359,7 +360,7 @@ eina_chained_mempool_repack(void *data, /* FIXME: Improvement - per Chained_Pool lock */ if (!eina_lock_take(&pool->mutex)) { -#ifdef EFL_DEBUG_THREADS +#ifdef EINA_HAVE_DEBUG_THREADS assert(pthread_equal(pool->self, pthread_self())); #endif } @@ -477,7 +478,7 @@ eina_chained_mempool_init(const char *context, VALGRIND_CREATE_MEMPOOL(mp, 0, 1); #endif -#ifdef EFL_DEBUG_THREADS +#ifdef EINA_HAVE_DEBUG_THREADS mp->self = pthread_self(); #endif @@ -521,7 +522,7 @@ eina_chained_mempool_shutdown(void *data) eina_lock_free(&mp->mutex); -#ifdef EFL_DEBUG_THREADS +#ifdef EINA_HAVE_DEBUG_THREADS assert(pthread_equal(mp->self, pthread_self())); #endif diff --git a/src/modules/eina/mp/one_big/eina_one_big.c b/src/modules/eina/mp/one_big/eina_one_big.c index c23c47837c..42c47ee685 100644 --- a/src/modules/eina/mp/one_big/eina_one_big.c +++ b/src/modules/eina/mp/one_big/eina_one_big.c @@ -35,6 +35,7 @@ # undef WIN32_LEAN_AND_MEAN #endif +#include "eina_config.h" #include "eina_mempool.h" #include "eina_trash.h" #include "eina_inlist.h" @@ -76,7 +77,7 @@ struct _One_Big Eina_Trash *empty; Eina_Inlist *over_list; -#ifdef EFL_DEBUG_THREADS +#ifdef EINA_HAVE_DEBUG_THREADS pthread_t self; #endif Eina_Lock mutex; @@ -90,7 +91,7 @@ eina_one_big_malloc(void *data, EINA_UNUSED unsigned int size) if (!eina_lock_take(&pool->mutex)) { -#ifdef EFL_DEBUG_THREADS +#ifdef EINA_HAVE_DEBUG_THREADS assert(pthread_equal(pool->self, pthread_self())); #endif } @@ -158,7 +159,7 @@ eina_one_big_free(void *data, void *ptr) if (!eina_lock_take(&pool->mutex)) { -#ifdef EFL_DEBUG_THREADS +#ifdef EINA_HAVE_DEBUG_THREADS assert(pthread_equal(pool->self, pthread_self())); #endif } @@ -231,7 +232,7 @@ eina_one_big_init(const char *context, memcpy((char *)pool->name, context, length); } -#ifdef EFL_DEBUG_THREADS +#ifdef EINA_HAVE_DEBUG_THREADS pool->self = pthread_self(); #endif eina_lock_new(&pool->mutex); @@ -251,7 +252,7 @@ eina_one_big_shutdown(void *data) if (!pool) return; if (!eina_lock_take(&pool->mutex)) { -#ifdef EFL_DEBUG_THREADS +#ifdef EINA_HAVE_DEBUG_THREADS assert(pthread_equal(pool->self, pthread_self())); #endif }