From d5d2d6e6c955f63b48a68ac598972e2afdbd591f Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 21 Feb 2012 16:50:00 +0100 Subject: [PATCH 1/1] Remove unused field "locked" in struct mdesc. --- src/xbt/mmalloc/mmprivate.h | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/xbt/mmalloc/mmprivate.h b/src/xbt/mmalloc/mmprivate.h index 28bb297dbe..62df14dd4d 100644 --- a/src/xbt/mmalloc/mmprivate.h +++ b/src/xbt/mmalloc/mmprivate.h @@ -156,7 +156,6 @@ struct mdesc { /* Semaphore locking the access to the heap */ sem_t sem; - char locked; /* Number of processes that attached the heap */ unsigned int refcount; @@ -252,18 +251,7 @@ extern void *mmorecore(struct mdesc *mdp, int size); * in a model-checking enabled tree. Without this protection, our malloc * implementation will not like multi-threading AT ALL. */ -#define LOCK(mdp) do { \ - if (0 && mdp->locked) { \ - fprintf(stderr,"panic! deadlock detected because %s is not reintrant.\n",__FUNCTION__); \ - abort(); \ - } \ - sem_wait(&mdp->sem); \ - mdp->locked=1; \ - } while(0) - -#define UNLOCK(mdp) do { \ - sem_post(&mdp->sem); \ - mdp->locked=0; \ - } while (0) +#define LOCK(mdp) sem_wait(&mdp->sem) +#define UNLOCK(mdp) sem_post(&mdp->sem) #endif /* __MMPRIVATE_H */ -- 2.20.1