Handle failure conditions correctly in pipes.

This commit is contained in:
Eric Holk
2012-07-10 10:58:44 -07:00
parent d07e537fc3
commit 26e6eb3d14
6 changed files with 48 additions and 19 deletions

View File

@@ -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;