From f7db2c30a659aae5fe59ba2be7ab72f8ca64f712 Mon Sep 17 00:00:00 2001 From: sof Date: Wed, 22 Sep 2004 16:37:34 +0000 Subject: [PATCH] [project @ 2004-09-22 16:37:23 by sof] Limit ThreadLabel API use to DEBUG only. --- ghc/rts/RtsStartup.c | 2 ++ ghc/rts/Schedule.c | 2 ++ ghc/rts/ThreadLabels.c | 3 +++ 3 files changed, 7 insertions(+) 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 */ -- 1.7.10.4