// -*- rust -*-
fn x(str s, int n) {
log s;
log n;
}
fn main() {
spawn x("hello from first spawned fn", 65);
spawn x("hello from second spawned fn", 66);
spawn x("hello from third spawned fn", 67);
let int i = 30;
while (i > 0) {
i = i - 1;
log "parent sleeping";
yield;
}
}
// xfail-stage0
// -*- rust -*-
fn x(str s, int n) {
log s;
log n;
}
fn main() {
spawn x("hello from first spawned fn", 65);
spawn x("hello from second spawned fn", 66);
spawn x("hello from third spawned fn", 67);
let int i = 30;
while (i > 0) {
i = i - 1;
log "parent sleeping";
yield;
}
}
// xfail-stage0
// xfail-stage1
// xfail-stage2
// -*- rust -*-
fn x(str s, int n) {
log s;
log n;
}
fn main() {
spawn x("hello from first spawned fn", 65);
spawn x("hello from second spawned fn", 66);
spawn x("hello from third spawned fn", 67);
let int i = 30;
while (i > 0) {
i = i - 1;
log "parent sleeping";
yield;
}
}
// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
// -*- rust -*-
fn x(str s, int n) {
log s;
log n;
}
fn main() {
spawn x("hello from first spawned fn", 65);
spawn x("hello from second spawned fn", 66);
spawn x("hello from third spawned fn", 67);
let int i = 30;
while (i > 0) {
i = i - 1;
log "parent sleeping";
yield;
}
}
// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
// -*- rust -*-
fn x(s: str, n: int) { log s; log n; }
fn main() {
spawn x("hello from first spawned fn", 65);
spawn x("hello from second spawned fn", 66);
spawn x("hello from third spawned fn", 67);
let i: int = 30;
while i > 0 { i = i - 1; log "parent sleeping"; yield; }
}
// xfail-stage1
// xfail-stage2
// xfail-stage3
// -*- rust -*-
fn x(s: str, n: int) { log s; log n; }
fn main() {
spawn x("hello from first spawned fn", 65);
spawn x("hello from second spawned fn", 66);
spawn x("hello from third spawned fn", 67);
let i: int = 30;
while i > 0 { i = i - 1; log "parent sleeping"; yield; }
}
// -*- rust -*-
use std;
import std::task::yield;
fn x(s: str, n: int) { log s; log n; }
fn main() {
spawn x("hello from first spawned fn", 65);
spawn x("hello from second spawned fn", 66);
spawn x("hello from third spawned fn", 67);
let i: int = 30;
while i > 0 { i = i - 1; log "parent sleeping"; yield(); }
}
// -*- rust -*-
use std;
import std::task::yield;
import std::task;
fn x(s: str, n: int) { log s; log n; }
fn main() {
task::_spawn(bind x("hello from first spawned fn", 65));
task::_spawn(bind x("hello from second spawned fn", 66));
task::_spawn(bind x("hello from third spawned fn", 67));
let i: int = 30;
while i > 0 { i = i - 1; log "parent sleeping"; yield(); }
}
// -*- rust -*-
use std;
import std::task::yield;
import std::task;
fn x(s: str, n: int) { log s; log n; }
fn main() {
task::_spawn(bind x("hello from first spawned fn", 65));
task::_spawn(bind x("hello from second spawned fn", 66));
task::_spawn(bind x("hello from third spawned fn", 67));
let i: int = 30;
while i > 0 { i = i - 1; log "parent sleeping"; yield(); }
}
// -*- rust -*-
use std;
import std::task::yield;
import std::task;
fn x(s: str, n: int) { log s; log n; }
fn main() {
task::spawn(bind x("hello from first spawned fn", 65));
task::spawn(bind x("hello from second spawned fn", 66));
task::spawn(bind x("hello from third spawned fn", 67));
let i: int = 30;
while i > 0 { i = i - 1; log "parent sleeping"; yield(); }
}
// -*- rust -*-
use std;
import std::task::yield;
import std::task;
fn x(s: -istr, n: int) { log s; log n; }
fn main() {
task::spawn(bind x(~"hello from first spawned fn", 65));
task::spawn(bind x(~"hello from second spawned fn", 66));
task::spawn(bind x(~"hello from third spawned fn", 67));
let i: int = 30;
while i > 0 { i = i - 1; log "parent sleeping"; yield(); }
}
// -*- rust -*-
use std;
import std::task::yield;
import std::task;
fn x(s: -str, n: int) { log s; log n; }
fn main() {
task::spawn(bind x("hello from first spawned fn", 65));
task::spawn(bind x("hello from second spawned fn", 66));
task::spawn(bind x("hello from third spawned fn", 67));
let i: int = 30;
while i > 0 { i = i - 1; log "parent sleeping"; yield(); }
}
// -*- rust -*-
use std;
import std::task::yield;
import std::task;
fn x(-s: str, n: int) { log s; log n; }
fn main() {
task::spawn(bind x("hello from first spawned fn", 65));
task::spawn(bind x("hello from second spawned fn", 66));
task::spawn(bind x("hello from third spawned fn", 67));
let i: int = 30;
while i > 0 { i = i - 1; log "parent sleeping"; yield(); }
}
// -*- rust -*-
use std;
import std::task::yield;
import std::task;
fn# x(&&args: (str, int)) {
let (s, n) = args;
log s; log n;
}
fn main() {
task::spawn2(("hello from first spawned fn", 65), x);
task::spawn2(("hello from second spawned fn", 66), x);
task::spawn2(("hello from third spawned fn", 67), x);
let i: int = 30;
while i > 0 { i = i - 1; log "parent sleeping"; yield(); }
}
// -*- rust -*-
use std;
import std::task::yield;
import std::task;
fn# x(&&args: (str, int)) {
let (s, n) = args;
log s; log n;
}
fn main() {
task::spawn(("hello from first spawned fn", 65), x);
task::spawn(("hello from second spawned fn", 66), x);
task::spawn(("hello from third spawned fn", 67), x);
let i: int = 30;
while i > 0 { i = i - 1; log "parent sleeping"; yield(); }
}
// -*- rust -*-
use std;
import std::task::yield;
import std::task;
fn x(&&args: (str, int)) {
let (s, n) = args;
log s; log n;
}
fn main() {
task::spawn(("hello from first spawned fn", 65), x);
task::spawn(("hello from second spawned fn", 66), x);
task::spawn(("hello from third spawned fn", 67), x);
let i: int = 30;
while i > 0 { i = i - 1; log "parent sleeping"; yield(); }
}
// -*- rust -*-
use std;
import task::yield;
import task;
fn x(&&args: (str, int)) {
let (s, n) = args;
log s; log n;
}
fn main() {
task::spawn(("hello from first spawned fn", 65), x);
task::spawn(("hello from second spawned fn", 66), x);
task::spawn(("hello from third spawned fn", 67), x);
let i: int = 30;
while i > 0 { i = i - 1; log "parent sleeping"; yield(); }
}
// -*- rust -*-
use std;
import task::yield;
import task;
fn x(&&args: (str, int)) {
let (s, n) = args;
log_full(core::debug, s); log_full(core::debug, n);
}
fn main() {
task::spawn(("hello from first spawned fn", 65), x);
task::spawn(("hello from second spawned fn", 66), x);
task::spawn(("hello from third spawned fn", 67), x);
let i: int = 30;
while i > 0 { i = i - 1; #debug("parent sleeping"); yield(); }
}
// -*- rust -*-
use std;
import task::yield;
import task;
fn x(&&args: (str, int)) {
let (s, n) = args;
log(debug, s); log(debug, n);
}
fn main() {
task::spawn(("hello from first spawned fn", 65), x);
task::spawn(("hello from second spawned fn", 66), x);
task::spawn(("hello from third spawned fn", 67), x);
let i: int = 30;
while i > 0 { i = i - 1; #debug("parent sleeping"); yield(); }
}
// -*- rust -*-
use std;
import task::yield;
import task;
fn x(s: str, n: int) {
log(debug, s);
log(debug, n);
}
fn main() {
task::spawn {|| x("hello from first spawned fn", 65); };
task::spawn {|| x("hello from second spawned fn", 66); };
task::spawn {|| x("hello from third spawned fn", 67); };
let i: int = 30;
while i > 0 { i = i - 1; #debug("parent sleeping"); yield(); }
}
// -*- rust -*-
use std;
import task::yield;
import task;
fn x(s: str, n: int) {
log(debug, s);
log(debug, n);
}
fn main() {
task::spawn {|| x("hello from first spawned fn", 65); };
task::spawn {|| x("hello from second spawned fn", 66); };
task::spawn {|| x("hello from third spawned fn", 67); };
let mut i: int = 30;
while i > 0 { i = i - 1; #debug("parent sleeping"); yield(); }
}
// -*- rust -*-
use std;
import task::yield;
import task;
fn x(s: str, n: int) {
log(debug, s);
log(debug, n);
}
fn main() {
task::spawn({|| x("hello from first spawned fn", 65); });
task::spawn({|| x("hello from second spawned fn", 66); });
task::spawn({|| x("hello from third spawned fn", 67); });
let mut i: int = 30;
while i > 0 { i = i - 1; #debug("parent sleeping"); yield(); }
}
// -*- rust -*-
use std;
import task::yield;
import task;
fn x(s: str, n: int) {
log(debug, s);
log(debug, n);
}
fn main() {
task::spawn(|| x("hello from first spawned fn", 65) );
task::spawn(|| x("hello from second spawned fn", 66) );
task::spawn(|| x("hello from third spawned fn", 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; #debug("parent sleeping"); yield(); }
}
// -*- rust -*-
use std;
import task::yield;
import task;
fn x(s: ~str, n: int) {
log(debug, s);
log(debug, n);
}
fn main() {
task::spawn(|| x(~"hello from first spawned fn", 65) );
task::spawn(|| x(~"hello from second spawned fn", 66) );
task::spawn(|| x(~"hello from third spawned fn", 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; #debug("parent sleeping"); yield(); }
}
// -*- rust -*-
use std;
import task::yield;
import task;
fn x(s: ~str, n: int) {
log(debug, s);
log(debug, n);
}
fn main() {
task::spawn(|| x(~"hello from first spawned fn", 65) );
task::spawn(|| x(~"hello from second spawned fn", 66) );
task::spawn(|| x(~"hello from third spawned fn", 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; debug!{"parent sleeping"}; yield(); }
}
// -*- rust -*-
use std;
import task::yield;
import task;
fn x(s: ~str, n: int) {
log(debug, s);
log(debug, n);
}
fn main() {
task::spawn(|| x(~"hello from first spawned fn", 65) );
task::spawn(|| x(~"hello from second spawned fn", 66) );
task::spawn(|| x(~"hello from third spawned fn", 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; debug!("parent sleeping"); yield(); }
}
// -*- rust -*-
use std;
use task::yield;
fn x(s: ~str, n: int) {
log(debug, s);
log(debug, n);
}
fn main() {
task::spawn(|| x(~"hello from first spawned fn", 65) );
task::spawn(|| x(~"hello from second spawned fn", 66) );
task::spawn(|| x(~"hello from third spawned fn", 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; debug!("parent sleeping"); yield(); }
}
// -*- rust -*-
extern mod std;
use task::yield;
fn x(s: ~str, n: int) {
log(debug, s);
log(debug, n);
}
fn main() {
task::spawn(|| x(~"hello from first spawned fn", 65) );
task::spawn(|| x(~"hello from second spawned fn", 66) );
task::spawn(|| x(~"hello from third spawned fn", 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; debug!("parent sleeping"); yield(); }
}
// -*- 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 task::yield;
fn x(s: ~str, n: int) {
log(debug, s);
log(debug, n);
}
fn main() {
task::spawn(|| x(~"hello from first spawned fn", 65) );
task::spawn(|| x(~"hello from second spawned fn", 66) );
task::spawn(|| x(~"hello from third spawned fn", 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; debug!("parent sleeping"); yield(); }
}
// -*- 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 x(s: ~str, n: int) {
log(debug, s);
log(debug, n);
}
fn main() {
task::spawn(|| x(~"hello from first spawned fn", 65) );
task::spawn(|| x(~"hello from second spawned fn", 66) );
task::spawn(|| x(~"hello from third spawned fn", 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; debug!("parent sleeping"); task::yield(); }
}
// -*- 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 x(s: ~str, n: int) {
log(debug, s);
log(debug, n);
}
pub fn main() {
task::spawn(|| x(~"hello from first spawned fn", 65) );
task::spawn(|| x(~"hello from second spawned fn", 66) );
task::spawn(|| x(~"hello from third spawned fn", 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; debug!("parent sleeping"); task::yield(); }
}
// -*- 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 x(s: ~str, n: int) {
debug!(s);
debug!(n);
}
pub fn main() {
task::spawn(|| x(~"hello from first spawned fn", 65) );
task::spawn(|| x(~"hello from second spawned fn", 66) );
task::spawn(|| x(~"hello from third spawned fn", 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; debug!("parent sleeping"); task::yield(); }
}
// -*- 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;
fn x(s: ~str, n: int) {
debug!(s);
debug!(n);
}
pub fn main() {
task::spawn(|| x(~"hello from first spawned fn", 65) );
task::spawn(|| x(~"hello from second spawned fn", 66) );
task::spawn(|| x(~"hello from third spawned fn", 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; debug!("parent sleeping"); task::yield(); }
}
// -*- 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;
fn x(s: ~str, n: int) {
info!(s);
info!(n);
}
pub fn main() {
task::spawn(|| x(~"hello from first spawned fn", 65) );
task::spawn(|| x(~"hello from second spawned fn", 66) );
task::spawn(|| x(~"hello from third spawned fn", 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; info!("parent sleeping"); task::yield(); }
}
// -*- 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;
fn x(s: ~str, n: int) {
info!(s);
info!(n);
}
pub fn main() {
task::spawn(|| x(~"hello from first spawned fn", 65) );
task::spawn(|| x(~"hello from second spawned fn", 66) );
task::spawn(|| x(~"hello from third spawned fn", 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; info!("parent sleeping"); task::deschedule(); }
}
// -*- 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;
fn x(s: ~str, n: int) {
info2!("{:?}", s);
info2!("{:?}", n);
}
pub fn main() {
task::spawn(|| x(~"hello from first spawned fn", 65) );
task::spawn(|| x(~"hello from second spawned fn", 66) );
task::spawn(|| x(~"hello from third spawned fn", 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; info2!("parent sleeping"); task::deschedule(); }
}
// -*- 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;
fn x(s: ~str, n: int) {
info!("{:?}", s);
info!("{:?}", n);
}
pub fn main() {
task::spawn(|| x(~"hello from first spawned fn", 65) );
task::spawn(|| x(~"hello from second spawned fn", 66) );
task::spawn(|| x(~"hello from third spawned fn", 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; info!("parent sleeping"); task::deschedule(); }
}
// 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;
fn x(s: ~str, n: int) {
info!("{:?}", s);
info!("{:?}", n);
}
pub fn main() {
task::spawn(|| x(~"hello from first spawned fn", 65) );
task::spawn(|| x(~"hello from second spawned fn", 66) );
task::spawn(|| x(~"hello from third spawned fn", 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; info!("parent sleeping"); task::deschedule(); }
}
// 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;
fn x(s: ~str, n: int) {
info!("{:?}", s);
info!("{:?}", n);
}
pub fn main() {
task::spawn(proc() x(~"hello from first spawned fn", 65) );
task::spawn(proc() x(~"hello from second spawned fn", 66) );
task::spawn(proc() x(~"hello from third spawned fn", 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; info!("parent sleeping"); task::deschedule(); }
}
// 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;
fn x(s: ~str, n: int) {
println!("{:?}", s);
println!("{:?}", n);
}
pub fn main() {
task::spawn(proc() x(~"hello from first spawned fn", 65) );
task::spawn(proc() x(~"hello from second spawned fn", 66) );
task::spawn(proc() x(~"hello from third spawned fn", 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; println!("parent sleeping"); task::deschedule(); }
}
// 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;
fn x(s: ~str, n: int) {
println!("{:?}", s);
println!("{:?}", n);
}
pub fn main() {
task::spawn(proc() x("hello from first spawned fn".to_owned(), 65) );
task::spawn(proc() x("hello from second spawned fn".to_owned(), 66) );
task::spawn(proc() x("hello from third spawned fn".to_owned(), 67) );
let mut i: int = 30;
while i > 0 { i = i - 1; println!("parent sleeping"); task::deschedule(); }
}
// 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;
fn x(s: StrBuf, n: int) {
println!("{:?}", s);
println!("{:?}", n);
}
pub fn main() {
task::spawn(proc() x("hello from first spawned fn".to_strbuf(), 65) );
task::spawn(proc() x("hello from second spawned fn".to_strbuf(), 66) );
task::spawn(proc() x("hello from third spawned fn".to_strbuf(), 67) );
let mut i: int = 30;
while i > 0 {
i = i - 1;
println!("parent sleeping");
task::deschedule();
}
}
// 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;
fn x(s: String, n: int) {
println!("{:?}", s);
println!("{:?}", n);
}
pub fn main() {
task::spawn(proc() x("hello from first spawned fn".to_strbuf(), 65) );
task::spawn(proc() x("hello from second spawned fn".to_strbuf(), 66) );
task::spawn(proc() x("hello from third spawned fn".to_strbuf(), 67) );
let mut i: int = 30;
while i > 0 {
i = i - 1;
println!("parent sleeping");
task::deschedule();
}
}
// 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;
fn x(s: String, n: int) {
println!("{:?}", s);
println!("{:?}", n);
}
pub fn main() {
task::spawn(proc() x("hello from first spawned fn".to_string(), 65) );
task::spawn(proc() x("hello from second spawned fn".to_string(), 66) );
task::spawn(proc() x("hello from third spawned fn".to_string(), 67) );
let mut i: int = 30;
while i > 0 {
i = i - 1;
println!("parent sleeping");
task::deschedule();
}
}
// 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;
fn x(s: String, n: int) {
println!("{:?}", s);
println!("{:?}", n);
}
pub fn main() {
task::spawn(proc() x("hello from first spawned fn".to_string(), 65) );
task::spawn(proc() x("hello from second spawned fn".to_string(), 66) );
task::spawn(proc() x("hello from third spawned fn".to_string(), 67) );
let mut i: int = 30;
while i > 0 {
i = i - 1;
println!("parent sleeping");
task::deschedule();
}
}
// 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;
fn x(s: String, n: int) {
println!("{}", s);
println!("{}", n);
}
pub fn main() {
task::spawn(proc() x("hello from first spawned fn".to_string(), 65) );
task::spawn(proc() x("hello from second spawned fn".to_string(), 66) );
task::spawn(proc() x("hello from third spawned fn".to_string(), 67) );
let mut i: int = 30;
while i > 0 {
i = i - 1;
println!("parent sleeping");
task::deschedule();
}
}
// 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;
fn x(s: String, n: int) {
println!("{}", s);
println!("{}", n);
}
pub fn main() {
task::spawn(move|| x("hello from first spawned fn".to_string(), 65) );
task::spawn(move|| x("hello from second spawned fn".to_string(), 66) );
task::spawn(move|| x("hello from third spawned fn".to_string(), 67) );
let mut i: int = 30;
while i > 0 {
i = i - 1;
println!("parent sleeping");
task::deschedule();
}
}
// 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;
fn x(s: String, n: int) {
println!("{}", s);
println!("{}", n);
}
pub fn main() {
let _t = Thread::spawn(|| x("hello from first spawned fn".to_string(), 65) );
let _t = Thread::spawn(|| x("hello from second spawned fn".to_string(), 66) );
let _t = Thread::spawn(|| x("hello from third spawned fn".to_string(), 67) );
let mut i: int = 30;
while i > 0 {
i = i - 1;
println!("parent sleeping");
Thread::yield_now();
}
}
// 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;
fn x(s: String, n: int) {
println!("{}", s);
println!("{}", n);
}
pub fn main() {
let _t = Thread::spawn(|| x("hello from first spawned fn".to_string(), 65) );
let _t = Thread::spawn(|| x("hello from second spawned fn".to_string(), 66) );
let _t = Thread::spawn(|| x("hello from third spawned fn".to_string(), 67) );
let mut i: int = 30;
while i > 0 {
i = i - 1;
println!("parent sleeping");
Thread::yield_now();
}
}
// 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;
fn x(s: String, n: isize) {
println!("{}", s);
println!("{}", n);
}
pub fn main() {
let _t = thread::scoped(|| x("hello from first spawned fn".to_string(), 65) );
let _t = thread::scoped(|| x("hello from second spawned fn".to_string(), 66) );
let _t = thread::scoped(|| x("hello from third spawned fn".to_string(), 67) );
let mut i = 30;
while i > 0 {
i = i - 1;
println!("parent sleeping");
thread::yield_now();
}
}
// 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;
fn x(s: String, n: isize) {
println!("{}", s);
println!("{}", n);
}
pub fn main() {
let t1 = thread::spawn(|| x("hello from first spawned fn".to_string(), 65) );
let t2 = thread::spawn(|| x("hello from second spawned fn".to_string(), 66) );
let t3 = thread::spawn(|| x("hello from third spawned fn".to_string(), 67) );
let mut i = 30;
while i > 0 {
i = i - 1;
println!("parent sleeping");
thread::yield_now();
}
t1.join();
t2.join();
t3.join();
}