[project @ 2005-11-02 13:05:30 by simonmar]
[ghc-hetmet.git] / ghc / rts / GC.c
index c4823bd..9a21af8 100644 (file)
@@ -724,6 +724,7 @@ GarbageCollect ( void (*get_roots)(evac_fn), rtsBool force_major_gc )
       StgTSO *tso;
       for (task = all_tasks; task != NULL; task = task->all_link) {
          if (!task->stopped && task->tso) {
+             ASSERT(task->tso->bound == task);
              tso = (StgTSO *) isAlive((StgClosure *)task->tso);
              if (tso == NULL) {
                  barf("task %p: main thread %d has been GC'd", 
@@ -1136,7 +1137,9 @@ GarbageCollect ( void (*get_roots)(evac_fn), rtsBool force_major_gc )
   resetNurseries();
 
   // start any pending finalizers 
+  RELEASE_SM_LOCK;
   scheduleFinalizers(last_free_capability, old_weak_ptr_list);
+  ACQUIRE_SM_LOCK;
   
   // send exceptions to any threads which were about to die 
   resurrectThreads(resurrected_threads);