[project @ 2003-12-15 16:45:23 by simonmar]
[ghc-hetmet.git] / ghc / rts / Capability.c
index dd5d0e7..6d2f43c 100644 (file)
@@ -150,9 +150,7 @@ void grabCapability(Capability** cap)
   free_capabilities = (*cap)->link;
   rts_n_free_capabilities--;
 #endif
-#ifdef RTS_SUPPORTS_THREADS
-    IF_DEBUG(scheduler, sched_belch("worker: got capability"));
-#endif
+  IF_DEBUG(scheduler, sched_belch("worker: got capability"));
 }
 
 /*
@@ -201,10 +199,8 @@ void releaseCapability(Capability* cap
     signalCondition(&thread_ready_cond);
     startSchedulerTaskIfNecessary();  // if there is more work to be done,
                                      // we'll need a new thread
-  }
-#endif
-#ifdef RTS_SUPPORTS_THREADS
     IF_DEBUG(scheduler, sched_belch("worker: released capability"));
+  }
 #endif
   return;
 }
@@ -364,6 +360,7 @@ passCapability(Mutex* pMutex, Capability* cap, Condition *pTargetThreadCond)
 #ifdef SMP
   #error SMP version not implemented
 #endif
+    ASSERT(rts_n_free_capabilities == 0);
     rts_n_free_capabilities = 1;
     signalCondition(pTargetThreadCond);
     passTarget = pTargetThreadCond;