[project @ 2004-09-22 16:37:23 by sof]
authorsof <unknown>
Wed, 22 Sep 2004 16:37:34 +0000 (16:37 +0000)
committersof <unknown>
Wed, 22 Sep 2004 16:37:34 +0000 (16:37 +0000)
Limit ThreadLabel API use to DEBUG only.

ghc/rts/RtsStartup.c
ghc/rts/Schedule.c
ghc/rts/ThreadLabels.c

index d605328..04bad6d 100644 (file)
@@ -193,8 +193,10 @@ hs_init(int *argc, char **argv[])
     /* initialise the stable pointer table */
     initStablePtrTable();
 
+#if defined(DEBUG)
     /* initialise thread label table (tso->char*) */
     initThreadLabelTable();
+#endif
 
 #if defined(PROFILING) || defined(DEBUG)
     initProfiling1();
index c845c3d..fb0b19e 100644 (file)
@@ -3441,8 +3441,10 @@ printAllThreads(void)
 
   for (t = all_threads; t != END_TSO_QUEUE; t = t->global_link) {
     debugBelch("\tthread %d @ %p ", t->id, (void *)t);
+#if defined(DEBUG)
     label = lookupThreadLabel(t->id);
     if (label) debugBelch("[\"%s\"] ",(char *)label);
+#endif
     printThreadStatus(t);
     debugBelch("\n");
   }
index 2856ae7..9b9f172 100644 (file)
@@ -13,6 +13,8 @@
 
 #include <stdlib.h>
 
+#if defined(DEBUG)
+/* to the end */
 static HashTable * threadLabels = NULL;
 
 void
@@ -45,3 +47,4 @@ removeThreadLabel(StgWord key)
     stgFree(old);
   }  
 }
+#endif /* DEBUG */