about summary refs log tree commit diff
path: root/src/rt/rust_task.h
diff options
context:
space:
mode:
authorEric Holk <eholk@mozilla.com>2011-06-20 17:19:50 -0700
committerGraydon Hoare <graydon@mozilla.com>2011-06-27 09:58:39 -0700
commit4bc773465fe95da37b8c867979786b190de6197c (patch)
tree668f9398ab5f977a5dfac6c9e9b807540fe745d1 /src/rt/rust_task.h
parent91eadfd1ea1544513258fc30bf94ef384db2ad90 (diff)
downloadrust-4bc773465fe95da37b8c867979786b190de6197c.tar.gz
rust-4bc773465fe95da37b8c867979786b190de6197c.zip
Basic multithreading support. The infinite loops test successfully maxes out the CPU.
Diffstat (limited to 'src/rt/rust_task.h')
-rw-r--r--src/rt/rust_task.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h
index a022a348667..db3c0367adb 100644
--- a/src/rt/rust_task.h
+++ b/src/rt/rust_task.h
@@ -50,6 +50,10 @@ rust_task : public maybe_proxy<rust_task>,
     rust_handle<rust_task> *handle;
 
     context ctx;
+    
+    // This flag indicates that a worker is either currently running the task
+    // or is about to run this task.
+    bool active;
 
     // Only a pointer to 'name' is kept, so it must live as long as this task.
     rust_task(rust_dom *dom,
@@ -111,6 +115,8 @@ rust_task : public maybe_proxy<rust_task>,
 
     frame_glue_fns *get_frame_glue_fns(uintptr_t fp);
     rust_crate_cache * get_crate_cache();
+
+    bool can_schedule();
 };
 
 //