X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/18830ad59a14b63f78de5f8c6864ec894b00f18e..176b21d6ac0835d9bb1a22f93410df314ba8a057:/src/xbt/mmalloc/mmprivate.h diff --git a/src/xbt/mmalloc/mmprivate.h b/src/xbt/mmalloc/mmprivate.h index b2dc18f833..28bb297dbe 100644 --- a/src/xbt/mmalloc/mmprivate.h +++ b/src/xbt/mmalloc/mmprivate.h @@ -223,7 +223,7 @@ struct mdesc { }; -int mmalloc_compare_mdesc(struct mdesc *mdp1, struct mdesc *mdp2, void *std_heap_addr); +int mmalloc_compare_mdesc(struct mdesc *mdp1, struct mdesc *mdp2); void mmalloc_display_info(void *h); @@ -246,15 +246,21 @@ extern void *__mmalloc_remap_core(xbt_mheap_t mdp); like sbrk(), but using mmap(). */ extern void *mmorecore(struct mdesc *mdp, int size); -/* Thread-safety (if the sem is already created) FIXME: KILLIT*/ -#define LOCK(mdp) do { \ - if (mdp->locked) \ - fprintf(stderr,"panic! I'm not reintrant\n"); \ - sem_wait(&mdp->sem); \ - mdp->locked=1; \ +/* Thread-safety (if the sem is already created) + * + * This is mandatory in the case where the user runs a parallel simulation + * 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; \