rust/tests/run-pass/sync.rs

19 lines
421 B
Rust
Raw Normal View History

// Just instantiate some data structures to make sure we got all their foreign items covered.
// Requires full MIR on Windows.
use std::sync;
fn main() {
let m = sync::Mutex::new(0);
2018-11-26 08:31:53 -06:00
drop(m.lock());
drop(m);
2019-06-30 09:45:41 -05:00
#[cfg(not(target_os = "windows"))] // TODO: implement RwLock on Windows
2018-08-30 02:20:08 -05:00
{
let rw = sync::RwLock::new(0);
2018-11-26 08:31:53 -06:00
drop(rw.read());
drop(rw.write());
2018-08-30 02:20:08 -05:00
drop(rw);
}
}