about summary refs log tree commit diff
path: root/src/libstd/rt/sched.rs
diff options
context:
space:
mode:
authorBen Blum <bblum@andrew.cmu.edu>2013-07-08 19:31:32 -0400
committerBen Blum <bblum@andrew.cmu.edu>2013-07-20 05:08:56 -0400
commite80efe3fda506877b3fb7ff0df5d97dffb6a906f (patch)
treebd84dc36ca507ed8d3d0e11b0044a8066f302a36 /src/libstd/rt/sched.rs
parent629f6e8d68be06bf07f803db64be6a917a66b2cf (diff)
downloadrust-e80efe3fda506877b3fb7ff0df5d97dffb6a906f.tar.gz
rust-e80efe3fda506877b3fb7ff0df5d97dffb6a906f.zip
Do a task-killed check at the start of task 'timeslices'.
Diffstat (limited to 'src/libstd/rt/sched.rs')
-rw-r--r--src/libstd/rt/sched.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libstd/rt/sched.rs b/src/libstd/rt/sched.rs
index 4e4145ddc16..4b51508f0a4 100644
--- a/src/libstd/rt/sched.rs
+++ b/src/libstd/rt/sched.rs
@@ -483,6 +483,11 @@ impl Scheduler {
 
             // Running tasks may have asked us to do some cleanup
             (*sched).run_cleanup_job();
+
+            // Must happen after running the cleanup job (of course).
+            // Might not be running in task context; if not, a later call to
+            // resume_task_immediately will take care of this.
+            (*sched).current_task.map(|t| t.death.check_killed());
         }
     }
 
@@ -524,6 +529,9 @@ impl Scheduler {
             // We could be executing in a different thread now
             let sched = Local::unsafe_borrow::<Scheduler>();
             (*sched).run_cleanup_job();
+
+            // As above, must happen after running the cleanup job.
+            (*sched).current_task.map(|t| t.death.check_killed());
         }
     }
 
@@ -559,6 +567,9 @@ impl Scheduler {
             // We could be executing in a different thread now
             let sched = Local::unsafe_borrow::<Scheduler>();
             (*sched).run_cleanup_job();
+
+            // As above, must happen after running the cleanup job.
+            (*sched).current_task.map(|t| t.death.check_killed());
         }
     }