X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=ghc%2Frts%2FThreadLabels.c;h=2856ae7bfd5f5a12c61ca23993ab7919ffdc0ae9;hb=182b16bccea2eab1a8af93a6246db3d391e436c7;hp=fda40c3f00bb6627774d225c39e3e3e6c932ad4e;hpb=9bcc295e75b8873915903f1b6aab2d29ed2f7bca;p=ghc-hetmet.git diff --git a/ghc/rts/ThreadLabels.c b/ghc/rts/ThreadLabels.c index fda40c3..2856ae7 100644 --- a/ghc/rts/ThreadLabels.c +++ b/ghc/rts/ThreadLabels.c @@ -1,14 +1,26 @@ +/* ----------------------------------------------------------------------------- + * ThreadLabels.c + * + * (c) The GHC Team 2002-2003 + * + * Table of thread labels. + * + * ---------------------------------------------------------------------------*/ #include "PosixSource.h" #include "ThreadLabels.h" +#include "RtsUtils.h" -HashTable * threadLabels = NULL; +#include + +static HashTable * threadLabels = NULL; void initThreadLabelTable(void) { - ASSERT(threadLabels == NULL); - threadLabels = allocHashTable(); + if (threadLabels == NULL) { + threadLabels = allocHashTable(); + } } void @@ -30,6 +42,6 @@ removeThreadLabel(StgWord key) void * old = NULL; if ((old = lookupHashTable(threadLabels,key))) { removeHashTable(threadLabels,key,old); - free(old); + stgFree(old); } }