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-29 18:47:47 -0700
committerEric Holk <eholk@mozilla.com>2011-06-29 18:47:47 -0700
commit63dcd325b909051f53682dc6ddb2d6768ffbbba3 (patch)
tree6bdf31fb67f6efc4f0f358a727a0053121e63780 /src/rt/rust_task.h
parentafabde19dcdae41fa60df37b4aa049f4dfe6ee5f (diff)
downloadrust-63dcd325b909051f53682dc6ddb2d6768ffbbba3.tar.gz
rust-63dcd325b909051f53682dc6ddb2d6768ffbbba3.zip
Adding support for pinning tasks to the currently running thread. Closes #598.
Diffstat (limited to 'src/rt/rust_task.h')
-rw-r--r--src/rt/rust_task.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h
index 54287df4414..428e3c13993 100644
--- a/src/rt/rust_task.h
+++ b/src/rt/rust_task.h
@@ -77,7 +77,8 @@ rust_task : public maybe_proxy<rust_task>,
     
     // This flag indicates that a worker is either currently running the task
     // or is about to run this task.
-    volatile bool active;
+    int running_on;
+    int pinned_on;
 
     memory_region local_region;
     memory_region synchronized_region;
@@ -143,7 +144,7 @@ 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();
+    bool can_schedule(int worker);
 
     void *malloc(size_t size, memory_region::memory_region_type type);
     void *calloc(size_t size);
@@ -151,6 +152,9 @@ rust_task : public maybe_proxy<rust_task>,
     void *realloc(void *mem, size_t size,
         memory_region::memory_region_type type);
     void free(void *mem, memory_region::memory_region_type type);
+
+    void pin();
+    void unpin();
 };
 
 //