+/* -----------------------------------------------------------------------------
+ * ThreadLabels.c
+ *
+ * (c) The GHC Team 2002-2003
+ *
+ * Table of thread labels.
+ *
+ * ---------------------------------------------------------------------------*/
#include "PosixSource.h"
#include "ThreadLabels.h"
+#include "RtsUtils.h"
#include <stdlib.h>
-HashTable * threadLabels = NULL;
+static HashTable * threadLabels = NULL;
void
initThreadLabelTable(void)
{
- ASSERT(threadLabels == NULL);
- threadLabels = allocHashTable();
+ if (threadLabels == NULL) {
+ threadLabels = allocHashTable();
+ }
}
void
void * old = NULL;
if ((old = lookupHashTable(threadLabels,key))) {
removeHashTable(threadLabels,key,old);
- free(old);
+ stgFree(old);
}
}