2011-05-31 17:44:54 -07:00
|
|
|
// -*- rust -*-
|
2012-12-10 17:32:48 -08:00
|
|
|
// 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.
|
|
|
|
|
2013-05-24 19:35:29 -07:00
|
|
|
use std::task;
|
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2012-08-20 12:23:37 -07:00
|
|
|
let mut result = None;
|
2013-05-06 19:29:04 -07:00
|
|
|
let mut builder = task::task();
|
2013-05-07 21:33:31 -07:00
|
|
|
builder.future_result(|r| { result = Some(r); });
|
2013-05-06 19:29:04 -07:00
|
|
|
builder.spawn(child);
|
2012-08-22 17:24:52 -07:00
|
|
|
error!("1");
|
2013-08-16 12:49:40 -07:00
|
|
|
task::deschedule();
|
2013-03-16 15:49:12 -04:00
|
|
|
result.unwrap().recv();
|
2011-08-12 18:34:19 -07:00
|
|
|
}
|
2011-05-31 17:44:54 -07:00
|
|
|
|
2012-08-22 17:24:52 -07:00
|
|
|
fn child() { error!("2"); }
|