disable slotmap debugging

Change-Id: I7f672adc1fef6616d7244f73214273236b42a0ca
This commit is contained in:
Harald Welte 2019-03-31 15:13:29 +02:00
parent 35ded29788
commit 13d0f8c3d3
1 changed files with 6 additions and 0 deletions

View File

@ -86,6 +86,7 @@ void _slotmap_del(struct slotmaps *maps, struct slot_mapping *map);
/* initialize the entire map collection */
struct slotmaps *slotmap_init(void *ctx);
#ifdef SLOTMAP_DEBUG
#define slotmaps_rdlock(maps) do { \
printf("%s:%u = slotmap_rdlock()\n", __FILE__, __LINE__); \
pthread_rwlock_rdlock(&(maps)->rwlock); \
@ -100,6 +101,11 @@ struct slotmaps *slotmap_init(void *ctx);
printf("%s:%u = slotmap_unlock()\n", __FILE__, __LINE__); \
pthread_rwlock_unlock(&(maps)->rwlock); \
} while (0)
#else
#define slotmaps_rdlock(maps) pthread_rwlock_rdlock(&(maps)->rwlock)
#define slotmaps_wrlock(maps) pthread_rwlock_wrlock(&(maps)->rwlock)
#define slotmaps_unlock(maps) pthread_rwlock_unlock(&(maps)->rwlock)
#endif
#ifdef REMSIM_SERVER