From 63dcd325b909051f53682dc6ddb2d6768ffbbba3 Mon Sep 17 00:00:00 2001 From: Eric Holk Date: Wed, 29 Jun 2011 18:47:47 -0700 Subject: Adding support for pinning tasks to the currently running thread. Closes #598. --- src/rt/rust_task.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/rt/rust_task.h') 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, // 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, 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, 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(); }; // -- cgit 1.4.1-3-g733a5