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-04-01 18:42:28 -0700
committerBrian Anderson <banderson@mozilla.com>2012-04-02 15:35:47 -0700
commite1858882a49bf0666d4ffb3f45989ac9dbe9c843 (patch)
tree71ef322a719ca53ad56124ca37eb5061b49f1c73 /src/rt/rust_kernel.h
parent3654ef00782cf9708196fd438ee08c751a5b699b (diff)
downloadrust-e1858882a49bf0666d4ffb3f45989ac9dbe9c843.tar.gz
rust-e1858882a49bf0666d4ffb3f45989ac9dbe9c843.zip
rt: Run a single-threaded scheduler on the main thread
Diffstat (limited to 'src/rt/rust_kernel.h')
-rw-r--r--src/rt/rust_kernel.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/rt/rust_kernel.h b/src/rt/rust_kernel.h
index 78548917ee5..8c1d33c6a5e 100644
--- a/src/rt/rust_kernel.h
+++ b/src/rt/rust_kernel.h
@@ -13,6 +13,9 @@ class rust_scheduler;
 
 typedef std::map<rust_sched_id, rust_scheduler*> sched_map;
 
+class rust_sched_driver;
+class rust_sched_launcher_factory;
+
 /**
  * A global object shared by all thread domains. Most of the data structures
  * in this class are synchronized since they are accessed from multiple
@@ -48,6 +51,11 @@ private:
     std::vector<rust_sched_id> join_list;
 
     rust_sched_reaper sched_reaper;
+    // The single-threaded scheduler that uses the main thread
+    rust_sched_id osmain_scheduler;
+    // Runs the single-threaded scheduler that executes tasks
+    // on the main thread
+    rust_sched_driver *osmain_driver;
 
 public:
 
@@ -66,11 +74,13 @@ public:
     void fail();
 
     rust_sched_id create_scheduler(size_t num_threads);
+    rust_sched_id create_scheduler(rust_sched_launcher_factory *launchfac,
+                                   size_t num_threads, bool allow_exit);
     rust_scheduler* get_scheduler_by_id(rust_sched_id id);
     // Called by a scheduler to indicate that it is terminating
     void release_scheduler_id(rust_sched_id id);
     void wait_for_schedulers();
-    int wait_for_exit();
+    int run();
 
 #ifdef __WIN32__
     void win32_require(LPCTSTR fn, BOOL ok);