X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FSchedule.c;h=9b151d728329ea76ffb39dc5f397246cad6a1e65;hb=58532eb46041aec8d4cbb48b054cb5b001edb43c;hp=f5cb5686005d303ae2eedb652a4c9e152e7b4f2e;hpb=1fb38442d3a55ac92795aa6c5ed4df82011df724;p=ghc-hetmet.git diff --git a/rts/Schedule.c b/rts/Schedule.c index f5cb568..9b151d7 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -1447,6 +1447,12 @@ delete_threads_and_gc: recent_activity = ACTIVITY_YES; } + if (heap_census) { + debugTrace(DEBUG_sched, "performing heap census"); + heapCensus(); + performHeapProfile = rtsFalse; + } + #if defined(THREADED_RTS) if (gc_type == PENDING_GC_PAR) { @@ -1454,12 +1460,6 @@ delete_threads_and_gc: } #endif - if (heap_census) { - debugTrace(DEBUG_sched, "performing heap census"); - heapCensus(); - performHeapProfile = rtsFalse; - } - if (heap_overflow && sched_state < SCHED_INTERRUPTING) { // GC set the heap_overflow flag, so we should proceed with // an orderly shutdown now. Ultimately we want the main @@ -2030,16 +2030,16 @@ exitScheduler (rtsBool wait_foreign USED_IF_THREADS) } sched_state = SCHED_SHUTTING_DOWN; + nat i; + + for (i = 0; i < n_capabilities; i++) { #if defined(THREADED_RTS) - { - nat i; - - for (i = 0; i < n_capabilities; i++) { - ASSERT(task->incall->tso == NULL); - shutdownCapability(&capabilities[i], task, wait_foreign); - } - } + ASSERT(task->incall->tso == NULL); + shutdownCapability(&capabilities[i], task, wait_foreign); #endif + traceCapsetRemoveCap(CAPSET_OSPROCESS_DEFAULT, i); + } + traceCapsetDelete(CAPSET_OSPROCESS_DEFAULT); boundTaskExiting(task); }