Yield after send

This commit is contained in:
Brian Anderson 2011-09-16 10:49:41 -07:00
parent 172df2e3a2
commit 4028a099f5
2 changed files with 29 additions and 0 deletions

View file

@ -551,6 +551,7 @@ chan_id_send(rust_task *task, type_desc *t, rust_task_id target_task_id,
port->remote_chan->send(sptr);
}
target_task->deref();
task->yield();
}
}

View file

@ -0,0 +1,28 @@
// FIXME #937
// xfail-fast
use std;
import std::task;
import std::comm;
import std::uint;
fn die() {
fail;
}
fn iloop() {
task::unsupervise();
let f = die;
task::spawn(f);
let p = comm::port::<()>();
let c = comm::chan(p);
while true {
comm::send(c, ());
}
}
fn main() {
for each i in uint::range(0u, 16u) {
let f = iloop;
task::spawn(f);
}
}