]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/sync/libc_pthread_rwlock_write_write_deadlock.rs
organize compile-fail tests in folders
[rust.git] / tests / compile-fail / sync / libc_pthread_rwlock_write_write_deadlock.rs
1 // ignore-windows: No libc on Windows
2
3 #![feature(rustc_private)]
4
5 extern crate libc;
6
7 fn main() {
8     let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
9     unsafe {
10         assert_eq!(libc::pthread_rwlock_wrlock(rw.get()), 0);
11         libc::pthread_rwlock_wrlock(rw.get()); //~ ERROR: deadlock
12     }
13 }