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-23 21:37:37 -04:00
|
|
|
// error-pattern: lifetime of variable does not enclose its declaration
|
2013-05-20 17:07:24 -07:00
|
|
|
extern mod extra;
|
|
|
|
use extra::sync;
|
2012-08-10 21:23:09 -04:00
|
|
|
|
2012-08-08 19:49:30 -04:00
|
|
|
fn main() {
|
2013-07-22 13:57:40 -07:00
|
|
|
let m = ~sync::Mutex::new();
|
2012-08-20 12:23:37 -07:00
|
|
|
let mut cond = None;
|
2013-11-21 17:23:21 -08:00
|
|
|
m.lock_cond(|c| {
|
2012-08-20 12:23:37 -07:00
|
|
|
cond = Some(c);
|
2013-11-21 17:23:21 -08:00
|
|
|
});
|
2013-03-16 15:49:12 -04:00
|
|
|
cond.unwrap().signal();
|
2012-08-08 19:49:30 -04:00
|
|
|
}
|