From: Arnaud Giersch Date: Tue, 21 Feb 2012 15:50:00 +0000 (+0100) Subject: Remove unused field "locked" in struct mdesc. X-Git-Tag: exp_20120308~34^2~17 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d5d2d6e6c955f63b48a68ac598972e2afdbd591f Remove unused field "locked" in struct mdesc. --- 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 */