]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/libc_pthread_rwlock_write_read_deadlock.rs
1b460e7174d28f40f8c56fc89fc15d7762ff4596
[rust.git] / tests / compile-fail / libc_pthread_rwlock_write_read_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_rdlock(rw.get()); //~ ERROR: deadlock
12     }
13 }