Yield after send
This commit is contained in:
parent
172df2e3a2
commit
4028a099f5
2 changed files with 29 additions and 0 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
28
src/test/run-pass/send-iloop.rs
Normal file
28
src/test/run-pass/send-iloop.rs
Normal 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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue