We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 325263f commit 7e89a51Copy full SHA for 7e89a51
src/test/run-pass/preempt.rs
@@ -13,7 +13,7 @@
13
14
fn starve_main(alive: chan<int>) {
15
debug!("signalling main");
16
- alive <| 1;
+ alive.recv(1);
17
debug!("starving main");
18
let i: int = 0;
19
loop { i += 1; }
@@ -22,10 +22,12 @@ fn starve_main(alive: chan<int>) {
22
pub fn main() {
23
let alive: port<int> = port();
24
debug!("main started");
25
- let s: task = spawn starve_main(chan(alive));
+ let s: task = do task::spawn {
26
+ starve_main(chan(alive));
27
+ };
28
let i: int;
29
debug!("main waiting for alive signal");
- alive |> i;
30
+ alive.send(i);
31
debug!("main got alive signal");
32
while i < 50 { debug!("main iterated"); i += 1; }
33
debug!("main completed");
0 commit comments