Close .ghci files after reading them; fixes trac #4487
[ghc-hetmet.git] / rts / Schedule.c
index 0850749..51f8e75 100644 (file)
@@ -1031,10 +1031,8 @@ scheduleHandleHeapOverflow( Capability *cap, StgTSO *t )
            cap->r.rNursery->n_blocks == 1) {  // paranoia to prevent infinite loop
                                               // if the nursery has only one block.
            
-           ACQUIRE_SM_LOCK
-           bd = allocGroup( blocks );
-           RELEASE_SM_LOCK
-           cap->r.rNursery->n_blocks += blocks;
+            bd = allocGroup_lock(blocks);
+            cap->r.rNursery->n_blocks += blocks;
            
            // link the new group into the list
            bd->link = cap->r.rCurrentNursery;
@@ -1607,7 +1605,8 @@ forkProcess(HsStablePtr *entry
        // Wipe our spare workers list, they no longer exist.  New
        // workers will be created if necessary.
        cap->spare_workers = NULL;
-       cap->returning_tasks_hd = NULL;
+        cap->n_spare_workers = 0;
+        cap->returning_tasks_hd = NULL;
        cap->returning_tasks_tl = NULL;
 #endif
 
@@ -1817,16 +1816,16 @@ resumeThread (void *task_)
 
     traceEventRunThread(cap, tso);
     
+    /* Reset blocking status */
+    tso->why_blocked  = NotBlocked;
+
     if ((tso->flags & TSO_BLOCKEX) == 0) {
         // avoid locking the TSO if we don't have to
         if (tso->blocked_exceptions != END_BLOCKED_EXCEPTIONS_QUEUE) {
-            awakenBlockedExceptionQueue(cap,tso);
+            maybePerformBlockedException(cap,tso);
         }
     }
     
-    /* Reset blocking status */
-    tso->why_blocked  = NotBlocked;
-    
     cap->r.rCurrentTSO = tso;
     cap->in_haskell = rtsTrue;
     errno = saved_errno;