Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove unused field "locked" in struct mdesc.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 21 Feb 2012 15:50:00 +0000 (16:50 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 21 Feb 2012 15:50:00 +0000 (16:50 +0100)
src/xbt/mmalloc/mmprivate.h

index 28bb297..62df14d 100644 (file)
@@ -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 */