about summary refs log tree commit diff
path: root/src/rt/rust_kernel.h
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-01-08 19:46:12 -0800
committerBrian Anderson <banderson@mozilla.com>2013-01-15 18:00:19 -0800
commit090b247056a9dd2d4d4a32c631fe2f0ddd3e744d (patch)
treeb7b9d7ab483fa7150480f90c9a5ad69905753685 /src/rt/rust_kernel.h
parent989667e545cb45265d3cb4b19500224459c3bf8c (diff)
downloadrust-090b247056a9dd2d4d4a32c631fe2f0ddd3e744d.tar.gz
rust-090b247056a9dd2d4d4a32c631fe2f0ddd3e744d.zip
Spawn new tasks onto the primary scheduler by default. #3760
Diffstat (limited to 'src/rt/rust_kernel.h')
-rw-r--r--src/rt/rust_kernel.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/rt/rust_kernel.h b/src/rt/rust_kernel.h
index cd52bfae8d3..13fd8934172 100644
--- a/src/rt/rust_kernel.h
+++ b/src/rt/rust_kernel.h
@@ -82,7 +82,8 @@ class rust_kernel {
     lock_and_signal rval_lock;
     int rval;
 
-    // Protects max_sched_id and sched_table, join_list, killed
+    // Protects max_sched_id and sched_table, join_list, killed,
+    // already_exiting
     lock_and_signal sched_lock;
     // The next scheduler id
     rust_sched_id max_sched_id;
@@ -95,8 +96,13 @@ class rust_kernel {
     // task group fails). This propagates to all new schedulers and tasks
     // created after it is set.
     bool killed;
+    bool already_exiting;
+
 
     rust_sched_reaper sched_reaper;
+
+    // The primary scheduler
+    rust_sched_id main_scheduler;
     // The single-threaded scheduler that uses the main thread
     rust_sched_id osmain_scheduler;
     // Runs the single-threaded scheduler that executes tasks
@@ -111,7 +117,9 @@ class rust_kernel {
     std::vector<rust_port_id> weak_task_chans;
 
     rust_scheduler* get_scheduler_by_id_nolock(rust_sched_id id);
+    void allow_scheduler_exit();
     void end_weak_tasks();
+    void begin_shutdown();
 
     // Used to communicate with the process-side, global libuv loop
     uintptr_t global_loop_chan;
@@ -155,6 +163,7 @@ public:
 
     void set_exit_status(int code);
 
+    rust_sched_id main_sched_id() { return main_scheduler; }
     rust_sched_id osmain_sched_id() { return osmain_scheduler; }
 
     void register_task();