about summary refs log tree commit diff
path: root/src/rt/rust_task.h
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-03-02 23:40:27 -0800
committerBrian Anderson <banderson@mozilla.com>2012-03-05 19:39:55 -0800
commit237652299ec5fa3529ac7bd1bfddc52b7526bb82 (patch)
tree005becc9376cdc71633bba87edbe78c8912efcc1 /src/rt/rust_task.h
parent0432030c2727183f3cbda0263de2ca2b90c37353 (diff)
rt: Protect cond and cond_name with the state_lock
Diffstat (limited to 'src/rt/rust_task.h')
-rw-r--r--src/rt/rust_task.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h
index cc4a2a0ffe3..a940b6299ac 100644
--- a/src/rt/rust_task.h
+++ b/src/rt/rust_task.h
@@ -68,8 +68,6 @@ rust_task : public kernel_owned<rust_task>, rust_cond
     // Fields known only to the runtime.
     rust_kernel *kernel;
     const char *const name;
-    rust_cond *cond;
-    const char *cond_name;
     int32_t list_index;
 
     rust_port_id next_port_id;
@@ -106,8 +104,11 @@ rust_task : public kernel_owned<rust_task>, rust_cond
 
 private:
 
+    // Protects state, cond, cond_name
     lock_and_signal state_lock;
     rust_task_list *state;
+    rust_cond *cond;
+    const char *cond_name;
 
     // Protects the killed flag
     lock_and_signal kill_lock;
@@ -162,7 +163,8 @@ public:
     void *realloc(void *data, size_t sz);
     void free(void *p);
 
-    void transition(rust_task_list *src, rust_task_list *dst);
+    void transition(rust_task_list *src, rust_task_list *dst,
+                    rust_cond *cond, const char* cond_name);
 
     void block(rust_cond *on, const char* name);
     void wakeup(rust_cond *from);
@@ -222,6 +224,8 @@ public:
     rust_port_selector *get_port_selector() { return &port_selector; }
 
     rust_task_list *get_state() { return state; }
+    rust_cond *get_cond() { return cond; }
+    const char *get_cond_name() { return cond_name; }
 };
 
 // This stuff is on the stack-switching fast path