diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-03-02 21:22:42 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-03-05 19:39:55 -0800 |
| commit | b2a075e20d07994c960a7598fee2771d10cb9989 (patch) | |
| tree | 4e7a2fd278e8fb43ea692c15a89b7daac158adf5 /src/rt/rust_task.h | |
| parent | d7298a797b1041e9e997378bdb3cd4923567b2d4 (diff) | |
rt: Protect rust_task::state with a lock
Diffstat (limited to 'src/rt/rust_task.h')
| -rw-r--r-- | src/rt/rust_task.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h index 300c1df133c..cc4a2a0ffe3 100644 --- a/src/rt/rust_task.h +++ b/src/rt/rust_task.h @@ -68,7 +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_task_list *state; rust_cond *cond; const char *cond_name; int32_t list_index; @@ -107,6 +106,9 @@ rust_task : public kernel_owned<rust_task>, rust_cond private: + lock_and_signal state_lock; + rust_task_list *state; + // Protects the killed flag lock_and_signal kill_lock; // Indicates that the task was killed and needs to unwind @@ -218,6 +220,8 @@ public: bool have_c_stack() { return c_stack != NULL; } rust_port_selector *get_port_selector() { return &port_selector; } + + rust_task_list *get_state() { return state; } }; // This stuff is on the stack-switching fast path |
