diff options
Diffstat (limited to 'src/rt')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 4 | ||||
| -rw-r--r-- | src/rt/rust_task.cpp | 6 | ||||
| -rw-r--r-- | src/rt/rust_task.h | 2 |
3 files changed, 5 insertions, 7 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 732dbaa3293..aa314d2811e 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -930,11 +930,11 @@ task_clear_event_reject(rust_task *task) { // Waits on an event, returning the pointer to the event that unblocked this // task. extern "C" void * -task_wait_event(rust_task *task) { +task_wait_event(rust_task *task, bool *killed) { // TODO: we should assert that the passed in task is the currently running // task. We wouldn't want to wait some other task. - return task->wait_event(); + return task->wait_event(killed); } extern "C" void diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index 6a9f5cf5001..f5e2fcc9a08 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -713,16 +713,14 @@ rust_task::allow_kill() { } void * -rust_task::wait_event() { +rust_task::wait_event(bool *killed) { scoped_lock with(state_lock); if(!event_reject) { block_locked(&event_cond, "waiting on event"); - bool killed = false; state_lock.unlock(); - yield(&killed); + yield(killed); state_lock.lock(); - // TODO: what is the right thing to do if we are killed? } event_reject = false; diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h index c5bdc50e430..6cb6dbaa653 100644 --- a/src/rt/rust_task.h +++ b/src/rt/rust_task.h @@ -316,7 +316,7 @@ public: this->event_reject = false; } - void *wait_event(); + void *wait_event(bool *killed); void signal_event(void *event); void cleanup_after_turn(); |
