diff options
| author | Ben Blum <bblum@andrew.cmu.edu> | 2012-07-10 21:55:44 -0400 |
|---|---|---|
| committer | Ben Blum <bblum@andrew.cmu.edu> | 2012-07-11 12:09:07 -0400 |
| commit | 74f4b8d901cf16ef8dc601749108f4d79d7b53e0 (patch) | |
| tree | 26b63d182fbcf441d4859b25826862d3bf149224 /src/rt/rust_task.h | |
| parent | 5d6d3d056592cf4d68afbce6084245ea6733865c (diff) | |
| download | rust-74f4b8d901cf16ef8dc601749108f4d79d7b53e0.tar.gz rust-74f4b8d901cf16ef8dc601749108f4d79d7b53e0.zip | |
Unify state_lock + kill_lock -> lifecycle_lock (#2787)
Diffstat (limited to 'src/rt/rust_task.h')
| -rw-r--r-- | src/rt/rust_task.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h index 3bde5202954..82896bf27b4 100644 --- a/src/rt/rust_task.h +++ b/src/rt/rust_task.h @@ -170,7 +170,8 @@ rust_task : public kernel_owned<rust_task> private: // Protects state, cond, cond_name - lock_and_signal state_lock; + // Protects the killed flag, disallow_kill flag, reentered_rust_stack + lock_and_signal lifecycle_lock; rust_task_state state; rust_cond *cond; const char *cond_name; @@ -179,8 +180,6 @@ private: rust_cond event_cond; void *event; - // Protects the killed flag, disallow_kill flag, reentered_rust_stack - lock_and_signal kill_lock; // Indicates that the task was killed and needs to unwind bool killed; // Indicates that we've called back into Rust from C @@ -243,10 +242,8 @@ public: rust_opaque_box *env, void *args); void start(); - bool running(); - bool blocked(); - bool blocked_on(rust_cond *cond); - bool dead(); + void assert_is_running(); + bool blocked_on(rust_cond *cond); // FIXME (#2851) Get rid of this. void *malloc(size_t sz, const char *tag, type_desc *td=0); void *realloc(void *data, size_t sz); @@ -438,7 +435,8 @@ rust_task::call_on_rust_stack(void *args, void *fn_ptr) { bool had_reentered_rust_stack = reentered_rust_stack; { - scoped_lock with(kill_lock); + // FIXME (#2787) This must be racy. Figure it out. + scoped_lock with(lifecycle_lock); reentered_rust_stack = true; } @@ -453,7 +451,7 @@ rust_task::call_on_rust_stack(void *args, void *fn_ptr) { next_c_sp = prev_c_sp; { - scoped_lock with(kill_lock); + scoped_lock with(lifecycle_lock); reentered_rust_stack = had_reentered_rust_stack; } |
