From: sof Date: Wed, 22 Sep 2004 16:37:34 +0000 (+0000) Subject: [project @ 2004-09-22 16:37:23 by sof] X-Git-Tag: Initial_conversion_from_CVS_complete~1580 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=f7db2c30a659aae5fe59ba2be7ab72f8ca64f712;p=ghc-hetmet.git [project @ 2004-09-22 16:37:23 by sof] Limit ThreadLabel API use to DEBUG only. --- diff --git a/ghc/rts/RtsStartup.c b/ghc/rts/RtsStartup.c index d605328..04bad6d 100644 --- a/ghc/rts/RtsStartup.c +++ b/ghc/rts/RtsStartup.c @@ -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(); diff --git a/ghc/rts/Schedule.c b/ghc/rts/Schedule.c index c845c3d..fb0b19e 100644 --- a/ghc/rts/Schedule.c +++ b/ghc/rts/Schedule.c @@ -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"); } diff --git a/ghc/rts/ThreadLabels.c b/ghc/rts/ThreadLabels.c index 2856ae7..9b9f172 100644 --- a/ghc/rts/ThreadLabels.c +++ b/ghc/rts/ThreadLabels.c @@ -13,6 +13,8 @@ #include +#if defined(DEBUG) +/* to the end */ static HashTable * threadLabels = NULL; void @@ -45,3 +47,4 @@ removeThreadLabel(StgWord key) stgFree(old); } } +#endif /* DEBUG */