// -*- rust -*-
io fn main() {
let port[int] p = port();
spawn child(chan(p));
let int y;
y <- p;
log "received";
log y;
check (y == 10);
}
io fn child(chan[int] c) {
c <| 10;
}
// -*- rust -*-
impure fn main() {
let port[int] p = port();
spawn child(chan(p));
let int y;
y <- p;
log "received";
log y;
check (y == 10);
}
impure fn child(chan[int] c) {
c <| 10;
}
// xfail-stage0
// -*- rust -*-
impure fn main() {
let port[int] p = port();
spawn child(chan(p));
let int y;
y <- p;
log "received";
log y;
check (y == 10);
}
impure fn child(chan[int] c) {
c <| 10;
}
// xfail-stage0
// -*- rust -*-
fn main() {
let port[int] p = port();
spawn child(chan(p));
let int y;
y <- p;
log "received";
log y;
check (y == 10);
}
fn child(chan[int] c) {
c <| 10;
}
// xfail-stage0
// -*- rust -*-
fn main() {
let port[int] p = port();
spawn child(chan(p));
let int y;
y <- p;
log "received";
log y;
assert (y == 10);
}
fn child(chan[int] c) {
c <| 10;
}
// xfail-stage0
// -*- rust -*-
fn main() {
let port[int] p = port();
spawn child(chan(p));
let int y;
y <- p;
log "received";
log y;
check (y == 10);
}
fn child(chan[int] c) {
c <| 10;
}
// xfail-stage0
// -*- rust -*-
fn main() {
let port[int] p = port();
spawn child(chan(p));
let int y;
y <- p;
log "received";
log y;
assert (y == 10);
}
fn child(chan[int] c) {
c <| 10;
}
// xfail-stage0
// xfail-stage1
// xfail-stage2
// -*- rust -*-
fn main() {
let port[int] p = port();
spawn child(chan(p));
let int y;
y <- p;
log "received";
log y;
assert (y == 10);
}
fn child(chan[int] c) {
c <| 10;
}
// xfail-stage0
// xfail-stage1
// xfail-stage2
// -*- rust -*-
fn main() {
let port[int] p = port();
spawn child(chan(p));
let int y;
p |> y;
log "received";
log y;
assert (y == 10);
}
fn child(chan[int] c) {
c <| 10;
}
// xfail-stage0
// xfail-stage1
// xfail-stage2
// -*- rust -*-
fn main() {
let port[int] p = port();
spawn child(chan(p));
let int y;
p |> y;
log_err "received";
log_err y;
//assert (y == 10);
}
fn child(chan[int] c) {
log_err "sending";
c <| 10;
log_err "value sent"
}
// xfail-stage0
// xfail-stage1
// xfail-stage2
// -*- rust -*-
fn main() {
let port[int] p = port();
let task t = spawn child(chan(p));
let int y;
p |> y;
log_err "received";
log_err y;
assert (y == 10);
}
fn child(chan[int] c) {
log_err "sending";
c <| 10;
log_err "value sent"
}
// xfail-stage0
// -*- rust -*-
fn main() {
let port[int] p = port();
let task t = spawn child(chan(p));
let int y;
p |> y;
log_err "received";
log_err y;
assert (y == 10);
}
fn child(chan[int] c) {
log_err "sending";
c <| 10;
log_err "value sent"
}
// xfail-stage0
// -*- rust -*-
fn main() {
let p: port[int] = port();
let t: task = spawn child(chan(p));
let y: int;
p |> y;
log_err "received";
log_err y;
assert (y == 10);
}
fn child(c: chan[int]) { log_err "sending"; c <| 10; log_err "value sent" }
// -*- rust -*-
fn main() {
let p: port[int] = port();
let t: task = spawn child(chan(p));
let y: int;
p |> y;
log_err "received";
log_err y;
assert (y == 10);
}
fn child(c: chan[int]) { log_err "sending"; c <| 10; log_err "value sent" }
// -*- rust -*-
use std;
import std::comm;
import std::comm::_chan;
import std::comm::send;
import std::task;
fn main() {
let p = comm::mk_port();
let t = task::_spawn(bind child(p.mk_chan()));
let y = p.recv();
log_err "received";
log_err y;
assert (y == 10);
}
fn child(c: _chan[int]) {
log_err "sending";
send(c, 10);
log_err "value sent"
}
// -*- rust -*-
use std;
import std::comm;
import std::comm::_chan;
import std::comm::send;
import std::task;
fn main() {
let p = comm::mk_port();
let t = task::_spawn(bind child(p.mk_chan()));
let y = p.recv();
log_err "received";
log_err y;
assert (y == 10);
}
fn child(c: _chan<int>) {
log_err "sending";
send(c, 10);
log_err "value sent"
}
// -*- rust -*-
use std;
import std::comm;
import std::comm::chan;
import std::comm::send;
import std::comm::recv;
import std::task;
fn main() {
let p = comm::port();
let t = task::spawn(bind child(chan(p)));
let y = recv(p);
log_err "received";
log_err y;
assert (y == 10);
}
fn child(c: chan<int>) {
log_err "sending";
send(c, 10);
log_err "value sent"
}
// -*- rust -*-
use std;
import std::comm;
import std::comm::chan;
import std::comm::send;
import std::comm::recv;
import std::task;
fn main() {
let p = comm::port();
let t = task::spawn2(chan(p), child);
let y = recv(p);
log_err "received";
log_err y;
assert (y == 10);
}
fn# child(c: chan<int>) {
log_err "sending";
send(c, 10);
log_err "value sent"
}
// -*- rust -*-
use std;
import std::comm;
import std::comm::chan;
import std::comm::send;
import std::comm::recv;
import std::task;
fn main() {
let p = comm::port();
let t = task::spawn(chan(p), child);
let y = recv(p);
log_err "received";
log_err y;
assert (y == 10);
}
fn# child(c: chan<int>) {
log_err "sending";
send(c, 10);
log_err "value sent"
}
// -*- rust -*-
use std;
import std::comm;
import std::comm::chan;
import std::comm::send;
import std::comm::recv;
import std::task;
fn main() {
let p = comm::port();
let t = task::spawn(chan(p), child);
let y = recv(p);
log_err "received";
log_err y;
assert (y == 10);
}
fn child(c: chan<int>) {
log_err "sending";
send(c, 10);
log_err "value sent"
}
// -*- rust -*-
use std;
import comm;
import comm::chan;
import comm::send;
import comm::recv;
import task;
fn main() {
let p = comm::port();
let t = task::spawn(chan(p), child);
let y = recv(p);
log_err "received";
log_err y;
assert (y == 10);
}
fn child(c: chan<int>) {
log_err "sending";
send(c, 10);
log_err "value sent"
}
// -*- rust -*-
use std;
import comm;
import comm::chan;
import comm::send;
import comm::recv;
import task;
fn main() {
let p = comm::port();
let t = task::spawn(chan(p), child);
let y = recv(p);
#error("received");
log_full(core::error, y);
assert (y == 10);
}
fn child(c: chan<int>) {
#error("sending");
send(c, 10);
log_err "value sent"
}
// -*- rust -*-
use std;
import comm;
import comm::chan;
import comm::send;
import comm::recv;
import task;
fn main() {
let p = comm::port();
let t = task::spawn(chan(p), child);
let y = recv(p);
#error("received");
log_full(core::error, y);
assert (y == 10);
}
fn child(c: chan<int>) {
#error("sending");
send(c, 10);
#error("value sent");
}
// -*- rust -*-
use std;
import comm;
import comm::chan;
import comm::send;
import comm::recv;
import task;
fn main() {
let p = comm::port();
let t = task::spawn(chan(p), child);
let y = recv(p);
#error("received");
log(error, y);
assert (y == 10);
}
fn child(c: chan<int>) {
#error("sending");
send(c, 10);
#error("value sent");
}
// -*- rust -*-
use std;
import comm;
import comm::chan;
import comm::send;
import comm::recv;
import task;
fn main() {
let p = comm::port();
let ch = comm::chan(p);
let t = task::spawn {|| child(ch); };
let y = recv(p);
#error("received");
log(error, y);
assert (y == 10);
}
fn child(c: chan<int>) {
#error("sending");
send(c, 10);
#error("value sent");
}
// -*- rust -*-
use std;
import comm;
import comm::chan;
import comm::send;
import comm::recv;
import task;
fn main() {
let p = comm::port();
let ch = comm::chan(p);
let t = task::spawn({|| child(ch); });
let y = recv(p);
#error("received");
log(error, y);
assert (y == 10);
}
fn child(c: chan<int>) {
#error("sending");
send(c, 10);
#error("value sent");
}
// -*- rust -*-
use std;
import comm;
import comm::chan;
import comm::send;
import comm::recv;
import task;
fn main() {
let p = comm::port();
let ch = comm::chan(p);
let t = task::spawn(|| child(ch) );
let y = recv(p);
#error("received");
log(error, y);
assert (y == 10);
}
fn child(c: chan<int>) {
#error("sending");
send(c, 10);
#error("value sent");
}
// -*- rust -*-
use std;
import comm;
import comm::chan;
import comm::send;
import comm::recv;
import task;
fn main() {
let p = comm::port();
let ch = comm::chan(p);
let t = task::spawn(|| child(ch) );
let y = recv(p);
error!{"received"};
log(error, y);
assert (y == 10);
}
fn child(c: chan<int>) {
error!{"sending"};
send(c, 10);
error!{"value sent"};
}
// -*- rust -*-
use std;
import comm;
import comm::Chan;
import comm::chan;
import comm::send;
import comm::recv;
import task;
fn main() {
let p = comm::port();
let ch = comm::chan(p);
let t = task::spawn(|| child(ch) );
let y = recv(p);
error!{"received"};
log(error, y);
assert (y == 10);
}
fn child(c: Chan<int>) {
error!{"sending"};
send(c, 10);
error!{"value sent"};
}
// -*- rust -*-
use std;
import comm;
import comm::Chan;
import comm::chan;
import comm::send;
import comm::recv;
import task;
fn main() {
let p = comm::port();
let ch = comm::chan(p);
let t = task::spawn(|| child(ch) );
let y = recv(p);
error!("received");
log(error, y);
assert (y == 10);
}
fn child(c: Chan<int>) {
error!("sending");
send(c, 10);
error!("value sent");
}
// -*- rust -*-
use std;
import comm;
import comm::Chan;
import comm::send;
import comm::recv;
import task;
fn main() {
let p = comm::Port();
let ch = comm::Chan(p);
let t = task::spawn(|| child(ch) );
let y = recv(p);
error!("received");
log(error, y);
assert (y == 10);
}
fn child(c: Chan<int>) {
error!("sending");
send(c, 10);
error!("value sent");
}
// -*- rust -*-
use std;
use comm::Chan;
use comm::send;
use comm::recv;
fn main() {
let p = comm::Port();
let ch = comm::Chan(p);
let t = task::spawn(|| child(ch) );
let y = recv(p);
error!("received");
log(error, y);
assert (y == 10);
}
fn child(c: Chan<int>) {
error!("sending");
send(c, 10);
error!("value sent");
}
// -*- rust -*-
extern mod std;
use comm::Chan;
use comm::send;
use comm::recv;
fn main() {
let p = comm::Port();
let ch = comm::Chan(p);
let t = task::spawn(|| child(ch) );
let y = recv(p);
error!("received");
log(error, y);
assert (y == 10);
}
fn child(c: Chan<int>) {
error!("sending");
send(c, 10);
error!("value sent");
}
// -*- rust -*-
extern mod std;
use comm::Chan;
use comm::send;
use comm::recv;
fn main() {
let p = comm::Port();
let ch = comm::Chan(&p);
let t = task::spawn(|| child(ch) );
let y = recv(p);
error!("received");
log(error, y);
assert (y == 10);
}
fn child(c: Chan<int>) {
error!("sending");
send(c, 10);
error!("value sent");
}
// -*- rust -*-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
extern mod std;
use comm::Chan;
use comm::send;
use comm::recv;
fn main() {
let p = comm::Port();
let ch = comm::Chan(&p);
let t = task::spawn(|| child(ch) );
let y = recv(p);
error!("received");
log(error, y);
assert (y == 10);
}
fn child(c: Chan<int>) {
error!("sending");
send(c, 10);
error!("value sent");
}
// -*- rust -*-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn main() {
let p = comm::Port();
let ch = core::comm::Chan(&p);
let t = task::spawn(|| child(ch) );
let y = core::comm::recv(p);
error!("received");
log(error, y);
assert (y == 10);
}
fn child(c: core::comm::Chan<int>) {
error!("sending");
core::comm::send(c, 10);
error!("value sent");
}
// -*- rust -*-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn main() {
let p = oldcomm::Port();
let ch = core::oldcomm::Chan(&p);
let t = task::spawn(|| child(ch) );
let y = core::oldcomm::recv(p);
error!("received");
log(error, y);
assert (y == 10);
}
fn child(c: core::oldcomm::Chan<int>) {
error!("sending");
core::oldcomm::send(c, 10);
error!("value sent");
}
// -*- rust -*-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn main() {
let p = oldcomm::Port();
let ch = ::core::oldcomm::Chan(&p);
let t = task::spawn(|| child(ch) );
let y = ::core::oldcomm::recv(p);
error!("received");
log(error, y);
assert (y == 10);
}
fn child(c: ::core::oldcomm::Chan<int>) {
error!("sending");
::core::oldcomm::send(c, 10);
error!("value sent");
}
// -*- rust -*-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use core::pipes::*;
fn main() {
let (p, ch) = stream();
let t = task::spawn(|| child(&ch) );
let y = p.recv();
error!("received");
log(error, y);
assert (y == 10);
}
fn child(c: &Chan<int>) {
error!("sending");
c.send(10);
error!("value sent");
}
// -*- rust -*-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use core::pipes::*;
pub fn main() {
let (p, ch) = stream();
let t = task::spawn(|| child(&ch) );
let y = p.recv();
error!("received");
log(error, y);
assert (y == 10);
}
fn child(c: &Chan<int>) {
error!("sending");
c.send(10);
error!("value sent");
}
// -*- rust -*-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use core::comm::*;
pub fn main() {
let (p, ch) = stream();
let t = task::spawn(|| child(&ch) );
let y = p.recv();
error!("received");
log(error, y);
assert (y == 10);
}
fn child(c: &Chan<int>) {
error!("sending");
c.send(10);
error!("value sent");
}
// -*- rust -*-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use core::comm::*;
pub fn main() {
let (p, ch) = stream();
let t = task::spawn(|| child(&ch) );
let y = p.recv();
error!("received");
log(error, y);
fail_unless!((y == 10));
}
fn child(c: &Chan<int>) {
error!("sending");
c.send(10);
error!("value sent");
}
// -*- rust -*-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use core::comm::*;
pub fn main() {
let (p, ch) = stream();
let t = task::spawn(|| child(&ch) );
let y = p.recv();
error!("received");
error!(y);
fail_unless!((y == 10));
}
fn child(c: &Chan<int>) {
error!("sending");
c.send(10);
error!("value sent");
}
// -*- rust -*-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use core::comm::*;
pub fn main() {
let (p, ch) = stream();
let t = task::spawn(|| child(&ch) );
let y = p.recv();
error!("received");
error!(y);
assert!((y == 10));
}
fn child(c: &Chan<int>) {
error!("sending");
c.send(10);
error!("value sent");
}
// -*- rust -*-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use core::comm::*;
pub fn main() {
let (p, ch) = stream();
let t = task::spawn(|| child(&ch) );
let y = p.recv();
error!("received");
error!(y);
assert_eq!(y, 10);
}
fn child(c: &Chan<int>) {
error!("sending");
c.send(10);
error!("value sent");
}
// -*- rust -*-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::comm::*;
pub fn main() {
let (p, ch) = stream();
let t = task::spawn(|| child(&ch) );
let y = p.recv();
error!("received");
error!(y);
assert_eq!(y, 10);
}
fn child(c: &Chan<int>) {
error!("sending");
c.send(10);
error!("value sent");
}
// -*- rust -*-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::comm::*;
use std::task;
pub fn main() {
let (p, ch) = stream();
let t = task::spawn(|| child(&ch) );
let y = p.recv();
error!("received");
error!(y);
assert_eq!(y, 10);
}
fn child(c: &Chan<int>) {
error!("sending");
c.send(10);
error!("value sent");
}
// -*- rust -*-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::task;
pub fn main() {
let (p, ch) = stream();
let _t = task::spawn(|| child(&ch) );
let y = p.recv();
error!("received");
error!(y);
assert_eq!(y, 10);
}
fn child(c: &Chan<int>) {
error!("sending");
c.send(10);
error!("value sent");
}
// -*- rust -*-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::task;
pub fn main() {
let (p, ch) = stream();
let _t = task::spawn(|| child(&ch) );
let y = p.recv();
error2!("received");
error2!("{:?}", y);
assert_eq!(y, 10);
}
fn child(c: &Chan<int>) {
error2!("sending");
c.send(10);
error2!("value sent");
}
// -*- rust -*-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::task;
pub fn main() {
let (p, ch) = stream();
let _t = task::spawn(|| child(&ch) );
let y = p.recv();
error!("received");
error!("{:?}", y);
assert_eq!(y, 10);
}
fn child(c: &Chan<int>) {
error!("sending");
c.send(10);
error!("value sent");
}
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::task;
pub fn main() {
let (p, ch) = stream();
let _t = task::spawn(|| child(&ch) );
let y = p.recv();
error!("received");
error!("{:?}", y);
assert_eq!(y, 10);
}
fn child(c: &Chan<int>) {
error!("sending");
c.send(10);
error!("value sent");
}
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::task;
pub fn main() {
let (p, ch) = stream();
let _t = task::spawn(proc() child(&ch));
let y = p.recv();
error!("received");
error!("{:?}", y);
assert_eq!(y, 10);
}
fn child(c: &Chan<int>) {
error!("sending");
c.send(10);
error!("value sent");
}
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::task;
pub fn main() {
let (p, ch) = Chan::new();
let _t = task::spawn(proc() { child(&ch) });
let y = p.recv();
error!("received");
error!("{:?}", y);
assert_eq!(y, 10);
}
fn child(c: &Chan<int>) {
error!("sending");
c.send(10);
error!("value sent");
}
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::task;
pub fn main() {
let (tx, rx) = channel();
let _t = task::spawn(proc() { child(&tx) });
let y = rx.recv();
error!("received");
error!("{:?}", y);
assert_eq!(y, 10);
}
fn child(c: &Sender<int>) {
error!("sending");
c.send(10);
error!("value sent");
}
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::task;
pub fn main() {
let (tx, rx) = channel();
let _t = task::spawn(proc() { child(&tx) });
let y = rx.recv();
println!("received");
println!("{:?}", y);
assert_eq!(y, 10);
}
fn child(c: &Sender<int>) {
error!("sending");
c.send(10);
println!("value sent");
}
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::task;
pub fn main() {
let (tx, rx) = channel();
let _t = task::spawn(proc() { child(&tx) });
let y = rx.recv();
println!("received");
println!("{:?}", y);
assert_eq!(y, 10);
}
fn child(c: &Sender<int>) {
println!("sending");
c.send(10);
println!("value sent");
}
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
extern crate debug;
use std::task;
pub fn main() {
let (tx, rx) = channel();
let _t = task::spawn(proc() { child(&tx) });
let y = rx.recv();
println!("received");
println!("{:?}", y);
assert_eq!(y, 10);
}
fn child(c: &Sender<int>) {
println!("sending");
c.send(10);
println!("value sent");
}
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::task;
pub fn main() {
let (tx, rx) = channel();
let _t = task::spawn(proc() { child(&tx) });
let y = rx.recv();
println!("received");
println!("{}", y);
assert_eq!(y, 10);
}
fn child(c: &Sender<int>) {
println!("sending");
c.send(10);
println!("value sent");
}
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::task;
pub fn main() {
let (tx, rx) = channel();
let _t = task::spawn(move|| { child(&tx) });
let y = rx.recv();
println!("received");
println!("{}", y);
assert_eq!(y, 10);
}
fn child(c: &Sender<int>) {
println!("sending");
c.send(10);
println!("value sent");
}
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::task;
use std::comm::{channel, Sender};
pub fn main() {
let (tx, rx) = channel();
let _t = task::spawn(move|| { child(&tx) });
let y = rx.recv();
println!("received");
println!("{}", y);
assert_eq!(y, 10);
}
fn child(c: &Sender<int>) {
println!("sending");
c.send(10);
println!("value sent");
}
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::task;
use std::sync::mpsc::{channel, Sender};
pub fn main() {
let (tx, rx) = channel();
let _t = task::spawn(move|| { child(&tx) });
let y = rx.recv().unwrap();
println!("received");
println!("{}", y);
assert_eq!(y, 10);
}
fn child(c: &Sender<int>) {
println!("sending");
c.send(10).unwrap();
println!("value sent");
}
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::thread::Thread;
use std::sync::mpsc::{channel, Sender};
pub fn main() {
let (tx, rx) = channel();
let _t = Thread::spawn(move|| { child(&tx) });
let y = rx.recv().unwrap();
println!("received");
println!("{}", y);
assert_eq!(y, 10);
}
fn child(c: &Sender<int>) {
println!("sending");
c.send(10).unwrap();
println!("value sent");
}
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(std_misc)]
use std::thread::Thread;
use std::sync::mpsc::{channel, Sender};
pub fn main() {
let (tx, rx) = channel();
let _t = Thread::spawn(move|| { child(&tx) });
let y = rx.recv().unwrap();
println!("received");
println!("{}", y);
assert_eq!(y, 10);
}
fn child(c: &Sender<int>) {
println!("sending");
c.send(10).unwrap();
println!("value sent");
}
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(std_misc)]
use std::thread::Thread;
use std::sync::mpsc::{channel, Sender};
pub fn main() {
let (tx, rx) = channel();
let _t = Thread::spawn(move|| { child(&tx) });
let y = rx.recv().unwrap();
println!("received");
println!("{}", y);
assert_eq!(y, 10);
}
fn child(c: &Sender<isize>) {
println!("sending");
c.send(10).unwrap();
println!("value sent");
}
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(std_misc)]
use std::thread;
use std::sync::mpsc::{channel, Sender};
pub fn main() {
let (tx, rx) = channel();
let _t = thread::scoped(move|| { child(&tx) });
let y = rx.recv().unwrap();
println!("received");
println!("{}", y);
assert_eq!(y, 10);
}
fn child(c: &Sender<isize>) {
println!("sending");
c.send(10).unwrap();
println!("value sent");
}
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(std_misc)]
use std::thread;
use std::sync::mpsc::{channel, Sender};
pub fn main() {
let (tx, rx) = channel();
let t = thread::spawn(move|| { child(&tx) });
let y = rx.recv().unwrap();
println!("received");
println!("{}", y);
assert_eq!(y, 10);
t.join();
}
fn child(c: &Sender<isize>) {
println!("sending");
c.send(10).unwrap();
println!("value sent");
}