};
-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);
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; \