summaryrefslogtreecommitdiff
path: root/rts/Schedule.c
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2006-05-25 09:00:35 +0000
committerSimon Marlow <simonmar@microsoft.com>2006-05-25 09:00:35 +0000
commit8846139a7c82feabb39d9d68d194178f649699cd (patch)
tree48dc248db3a3f82886759530b9e8cf4e3ddfa244 /rts/Schedule.c
parent7a1f8fbdbab99465793c50bd9fb376c950e7e9d7 (diff)
downloadhaskell-8846139a7c82feabb39d9d68d194178f649699cd.tar.gz
performGC_(): don't use the existing Task, always grab a new one
Diffstat (limited to 'rts/Schedule.c')
-rw-r--r--rts/Schedule.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c
index 52fd4d5df6..c652e18151 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