about summary refs log tree commit diff
path: root/src/rt/rust_kernel.h
diff options
context:
space:
mode:
authorBen Blum <bblum@andrew.cmu.edu>2012-07-20 18:06:17 -0400
committerBen Blum <bblum@andrew.cmu.edu>2012-07-20 19:23:19 -0400
commit5bb4a12900969b3250c490a5e0682c658fe65ba8 (patch)
tree9fee7318849691fd35658af7363dfdd8d433b0c9 /src/rt/rust_kernel.h
parentf55999fd7a03b4f876e69e94e491d3c30bf0c076 (diff)
downloadrust-5bb4a12900969b3250c490a5e0682c658fe65ba8.tar.gz
rust-5bb4a12900969b3250c490a5e0682c658fe65ba8.zip
[1/4 for #2365, #2671] Fix create/kill race with schedulers and tasks during rust_kernel::fail
Diffstat (limited to 'src/rt/rust_kernel.h')
-rw-r--r--src/rt/rust_kernel.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rt/rust_kernel.h b/src/rt/rust_kernel.h
index ba2c6a7bff0..00c78dea2f9 100644
--- a/src/rt/rust_kernel.h
+++ b/src/rt/rust_kernel.h
@@ -72,7 +72,7 @@ class rust_kernel {
     lock_and_signal rval_lock;
     int rval;
 
-    // Protects max_sched_id and sched_table, join_list
+    // Protects max_sched_id and sched_table, join_list, killed
     lock_and_signal sched_lock;
     // The next scheduler id
     rust_sched_id max_sched_id;
@@ -81,6 +81,10 @@ class rust_kernel {
     sched_map sched_table;
     // A list of scheduler ids that are ready to exit
     std::vector<rust_sched_id> join_list;
+    // Whether or not the runtime has to die (triggered when the root/main
+    // task group fails). This propagates to all new schedulers and tasks
+    // created after it is set.
+    bool killed;
 
     rust_sched_reaper sched_reaper;
     // The single-threaded scheduler that uses the main thread