X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fsm%2FGC.c;h=a8c637d211b42849517e7d5255488605a85eff38;hb=1d0e86e6cd96ce49f478c91fc01de565416ecc22;hp=f869ec415125cea5d4008cb84fb550da8ca8e0f2;hpb=0b43af1b2523a7938fc8aacedb23948e3aa1b7b5;p=ghc-hetmet.git diff --git a/rts/sm/GC.c b/rts/sm/GC.c index f869ec4..a8c637d 100644 --- a/rts/sm/GC.c +++ b/rts/sm/GC.c @@ -692,6 +692,7 @@ GarbageCollect ( rtsBool force_major_gc ) // send exceptions to any threads which were about to die RELEASE_SM_LOCK; resurrectThreads(resurrected_threads); + performPendingThrowTos(exception_threads); ACQUIRE_SM_LOCK; // Update the stable pointer hash table. @@ -906,7 +907,7 @@ loop: gct->thread_index, r); while (gc_running_threads != 0) { - usleep(1); + // usleep(1); if (any_work()) { inc_running(); goto loop; @@ -1078,14 +1079,19 @@ init_collected_gen (nat g, nat n_threads) for (s = 0; s < generations[g].n_steps; s++) { + stp = &generations[g].steps[s]; + ASSERT(stp->gen_no == g); + + // we'll construct a new list of threads in this step + // during GC, throw away the current list. + stp->old_threads = stp->threads; + stp->threads = END_TSO_QUEUE; + // generation 0, step 0 doesn't need to-space if (g == 0 && s == 0 && RtsFlags.GcFlags.generations > 1) { continue; } - stp = &generations[g].steps[s]; - ASSERT(stp->gen_no == g); - // deprecate the existing blocks stp->old_blocks = stp->blocks; stp->n_old_blocks = stp->n_blocks;