summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-10-10 21:48:34 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-10-10 21:48:34 +0000
commitc432e725824c749af5ac6f437fcc94becc9a597f (patch)
tree5128601103ccfdeb3261d98c7d2c65e75089c82b /src/modules
parent6589b75b984d7afce960f76bce83063743eddde9 (diff)
efl: unify EFL_DEBUG_THREADS and EINA_HAVE_DEBUG_THREADS
SVN revision: 77821
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/eina/mp/chained_pool/eina_chained_mempool.c15
-rw-r--r--src/modules/eina/mp/one_big/eina_one_big.c11
2 files changed, 14 insertions, 12 deletions
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 @@
26#ifdef EFL_HAVE_POSIX_THREADS 26#ifdef EFL_HAVE_POSIX_THREADS
27#include <pthread.h> 27#include <pthread.h>
28 28
29# ifdef EFL_DEBUG_THREADS 29# ifdef EINA_HAVE_DEBUG_THREADS
30# include <assert.h> 30# include <assert.h>
31# endif 31# endif
32#endif 32#endif
@@ -41,6 +41,7 @@
41# undef WIN32_LEAN_AND_MEAN 41# undef WIN32_LEAN_AND_MEAN
42#endif 42#endif
43 43
44#include "eina_config.h"
44#include "eina_inlist.h" 45#include "eina_inlist.h"
45#include "eina_error.h" 46#include "eina_error.h"
46#include "eina_module.h" 47#include "eina_module.h"
@@ -81,7 +82,7 @@ struct _Chained_Mempool
81#ifdef EINA_DEBUG_MALLOC 82#ifdef EINA_DEBUG_MALLOC
82 int minimal_size; 83 int minimal_size;
83#endif 84#endif
84#ifdef EFL_DEBUG_THREADS 85#ifdef EINA_HAVE_DEBUG_THREADS
85 pthread_t self; 86 pthread_t self;
86#endif 87#endif
87 Eina_Lock mutex; 88 Eina_Lock mutex;
@@ -264,7 +265,7 @@ eina_chained_mempool_malloc(void *data, EINA_UNUSED unsigned int size)
264 265
265 if (!eina_lock_take(&pool->mutex)) 266 if (!eina_lock_take(&pool->mutex))
266 { 267 {
267#ifdef EFL_DEBUG_THREADS 268#ifdef EINA_HAVE_DEBUG_THREADS
268 assert(pthread_equal(pool->self, pthread_self())); 269 assert(pthread_equal(pool->self, pthread_self()));
269#endif 270#endif
270 } 271 }
@@ -314,7 +315,7 @@ eina_chained_mempool_free(void *data, void *ptr)
314 // look 4 pool 315 // look 4 pool
315 if (!eina_lock_take(&pool->mutex)) 316 if (!eina_lock_take(&pool->mutex))
316 { 317 {
317#ifdef EFL_DEBUG_THREADS 318#ifdef EINA_HAVE_DEBUG_THREADS
318 assert(pthread_equal(pool->self, pthread_self())); 319 assert(pthread_equal(pool->self, pthread_self()));
319#endif 320#endif
320 } 321 }
@@ -359,7 +360,7 @@ eina_chained_mempool_repack(void *data,
359 /* FIXME: Improvement - per Chained_Pool lock */ 360 /* FIXME: Improvement - per Chained_Pool lock */
360 if (!eina_lock_take(&pool->mutex)) 361 if (!eina_lock_take(&pool->mutex))
361 { 362 {
362#ifdef EFL_DEBUG_THREADS 363#ifdef EINA_HAVE_DEBUG_THREADS
363 assert(pthread_equal(pool->self, pthread_self())); 364 assert(pthread_equal(pool->self, pthread_self()));
364#endif 365#endif
365 } 366 }
@@ -477,7 +478,7 @@ eina_chained_mempool_init(const char *context,
477 VALGRIND_CREATE_MEMPOOL(mp, 0, 1); 478 VALGRIND_CREATE_MEMPOOL(mp, 0, 1);
478#endif 479#endif
479 480
480#ifdef EFL_DEBUG_THREADS 481#ifdef EINA_HAVE_DEBUG_THREADS
481 mp->self = pthread_self(); 482 mp->self = pthread_self();
482#endif 483#endif
483 484
@@ -521,7 +522,7 @@ eina_chained_mempool_shutdown(void *data)
521 522
522 eina_lock_free(&mp->mutex); 523 eina_lock_free(&mp->mutex);
523 524
524#ifdef EFL_DEBUG_THREADS 525#ifdef EINA_HAVE_DEBUG_THREADS
525 assert(pthread_equal(mp->self, pthread_self())); 526 assert(pthread_equal(mp->self, pthread_self()));
526#endif 527#endif
527 528
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 @@
35# undef WIN32_LEAN_AND_MEAN 35# undef WIN32_LEAN_AND_MEAN
36#endif 36#endif
37 37
38#include "eina_config.h"
38#include "eina_mempool.h" 39#include "eina_mempool.h"
39#include "eina_trash.h" 40#include "eina_trash.h"
40#include "eina_inlist.h" 41#include "eina_inlist.h"
@@ -76,7 +77,7 @@ struct _One_Big
76 Eina_Trash *empty; 77 Eina_Trash *empty;
77 Eina_Inlist *over_list; 78 Eina_Inlist *over_list;
78 79
79#ifdef EFL_DEBUG_THREADS 80#ifdef EINA_HAVE_DEBUG_THREADS
80 pthread_t self; 81 pthread_t self;
81#endif 82#endif
82 Eina_Lock mutex; 83 Eina_Lock mutex;
@@ -90,7 +91,7 @@ eina_one_big_malloc(void *data, EINA_UNUSED unsigned int size)
90 91
91 if (!eina_lock_take(&pool->mutex)) 92 if (!eina_lock_take(&pool->mutex))
92 { 93 {
93#ifdef EFL_DEBUG_THREADS 94#ifdef EINA_HAVE_DEBUG_THREADS
94 assert(pthread_equal(pool->self, pthread_self())); 95 assert(pthread_equal(pool->self, pthread_self()));
95#endif 96#endif
96 } 97 }
@@ -158,7 +159,7 @@ eina_one_big_free(void *data, void *ptr)
158 159
159 if (!eina_lock_take(&pool->mutex)) 160 if (!eina_lock_take(&pool->mutex))
160 { 161 {
161#ifdef EFL_DEBUG_THREADS 162#ifdef EINA_HAVE_DEBUG_THREADS
162 assert(pthread_equal(pool->self, pthread_self())); 163 assert(pthread_equal(pool->self, pthread_self()));
163#endif 164#endif
164 } 165 }
@@ -231,7 +232,7 @@ eina_one_big_init(const char *context,
231 memcpy((char *)pool->name, context, length); 232 memcpy((char *)pool->name, context, length);
232 } 233 }
233 234
234#ifdef EFL_DEBUG_THREADS 235#ifdef EINA_HAVE_DEBUG_THREADS
235 pool->self = pthread_self(); 236 pool->self = pthread_self();
236#endif 237#endif
237 eina_lock_new(&pool->mutex); 238 eina_lock_new(&pool->mutex);
@@ -251,7 +252,7 @@ eina_one_big_shutdown(void *data)
251 if (!pool) return; 252 if (!pool) return;
252 if (!eina_lock_take(&pool->mutex)) 253 if (!eina_lock_take(&pool->mutex))
253 { 254 {
254#ifdef EFL_DEBUG_THREADS 255#ifdef EINA_HAVE_DEBUG_THREADS
255 assert(pthread_equal(pool->self, pthread_self())); 256 assert(pthread_equal(pool->self, pthread_self()));
256#endif 257#endif
257 } 258 }