[project @ 2004-10-03 16:37:42 by panne]
[ghc-hetmet.git] / ghc / rts / Schedule.c
index 9e2a5d0..04e9f1f 100644 (file)
@@ -216,7 +216,9 @@ void            addToBlockedQueue ( StgTSO *tso );
 static void     schedule          ( StgMainThread *mainThread, Capability *initialCapability );
        void     interruptStgRts   ( void );
 
+#if !defined(PAR) && !defined(RTS_SUPPORTS_THREADS)
 static void     detectBlackHoles  ( void );
+#endif
 
 #if defined(RTS_SUPPORTS_THREADS)
 /* ToDo: carefully document the invariants that go together
@@ -3286,6 +3288,7 @@ resurrectThreads( StgTSO *threads )
  * Locks: sched_mutex is held upon entry and exit.
  * -------------------------------------------------------------------------- */
 
+#if !defined(PAR) && !defined(RTS_SUPPORTS_THREADS)
 static void
 detectBlackHoles( void )
 {
@@ -3336,6 +3339,7 @@ detectBlackHoles( void )
        done: ;
     }
 }
+#endif
 
 /* ----------------------------------------------------------------------------
  * Debugging: why is a thread blocked
@@ -3417,7 +3421,6 @@ void
 printAllThreads(void)
 {
   StgTSO *t;
-  void *label;
 
 # if defined(GRAN)
   char time_string[TIME_STR_LEN], node_str[NODE_STR_LEN];
@@ -3437,8 +3440,12 @@ printAllThreads(void)
 
   for (t = all_threads; t != END_TSO_QUEUE; t = t->global_link) {
     debugBelch("\tthread %d @ %p ", t->id, (void *)t);
-    label = lookupThreadLabel(t->id);
-    if (label) debugBelch("[\"%s\"] ",(char *)label);
+#if defined(DEBUG)
+    {
+      void *label = lookupThreadLabel(t->id);
+      if (label) debugBelch("[\"%s\"] ",(char *)label);
+    }
+#endif
     printThreadStatus(t);
     debugBelch("\n");
   }