about summary refs log tree commit diff
path: root/src/rt/rust_kernel.h
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-02-07 16:11:57 -0800
committerBrian Anderson <banderson@mozilla.com>2012-02-08 15:42:51 -0800
commitf2a1aa2649ad030f189c54245ee182a0aa6983ed (patch)
tree2bb59ac5f6ea60227f4c33a61228ba4441410530 /src/rt/rust_kernel.h
parent028af5cb6c588a33b0bf5cbf451236407f5ba110 (diff)
downloadrust-f2a1aa2649ad030f189c54245ee182a0aa6983ed.tar.gz
rust-f2a1aa2649ad030f189c54245ee182a0aa6983ed.zip
rt: Hold schedulers in a map
Diffstat (limited to 'src/rt/rust_kernel.h')
-rw-r--r--src/rt/rust_kernel.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/rt/rust_kernel.h b/src/rt/rust_kernel.h
index 34797120ac5..2b7662220fd 100644
--- a/src/rt/rust_kernel.h
+++ b/src/rt/rust_kernel.h
@@ -2,12 +2,15 @@
 #ifndef RUST_KERNEL_H
 #define RUST_KERNEL_H
 
+#include <map>
 #include "memory_region.h"
 #include "rust_log.h"
 
 struct rust_task_thread;
 struct rust_scheduler;
 
+typedef std::map<rust_sched_id, rust_scheduler*> sched_map;
+
 /**
  * A global object shared by all thread domains. Most of the data structures
  * in this class are synchronized since they are accessed from multiple
@@ -20,8 +23,6 @@ class rust_kernel {
 public:
     rust_srv *srv;
 private:
-    rust_scheduler *sched;
-
     // Protects live_tasks, max_task_id and task_table
     lock_and_signal task_lock;
     // Tracks the number of tasks that are being managed by
@@ -35,12 +36,14 @@ private:
     lock_and_signal rval_lock;
     int rval;
 
-    // Protects live_schedulers
+    // Protects live_schedulers, max_sched_id and sched_table
     lock_and_signal sched_lock;
     // Tracks the number of schedulers currently running.
     // When this hits 0 we will signal the sched_lock and the
     // kernel will terminate.
     uintptr_t live_schedulers;
+    rust_sched_id max_sched_id;
+    sched_map sched_table;
 
 public: