From: Simon Marlow Date: Thu, 25 May 2006 09:00:35 +0000 (+0000) Subject: performGC_(): don't use the existing Task, always grab a new one X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;ds=sidebyside;h=8846139a7c82feabb39d9d68d194178f649699cd;hp=7a1f8fbdbab99465793c50bd9fb376c950e7e9d7;p=ghc-hetmet.git performGC_(): don't use the existing Task, always grab a new one --- diff --git a/rts/Schedule.c b/rts/Schedule.c index 52fd4d5..c652e18 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -3016,17 +3016,15 @@ static void (*extra_roots)(evac_fn); static void performGC_(rtsBool force_major, void (*get_roots)(evac_fn)) { - Task *task = myTask(); - - if (task == NULL) { - ACQUIRE_LOCK(&sched_mutex); - task = newBoundTask(); - RELEASE_LOCK(&sched_mutex); - scheduleDoGC(NULL,task,force_major, get_roots); - boundTaskExiting(task); - } else { - scheduleDoGC(NULL,task,force_major, get_roots); - } + Task *task; + // We must grab a new Task here, because the existing Task may be + // associated with a particular Capability, and chained onto the + // suspended_ccalling_tasks queue. + ACQUIRE_LOCK(&sched_mutex); + task = newBoundTask(); + RELEASE_LOCK(&sched_mutex); + scheduleDoGC(NULL,task,force_major, get_roots); + boundTaskExiting(task); } void