rust/tests/fail/sync/libc_pthread_rwlock_destroy_write_locked.rs

14 lines
349 B
Rust
Raw Normal View History

//@ignore-target-windows: No libc on Windows
2020-04-05 14:55:57 -05:00
#![feature(rustc_private)]
extern crate libc;
fn main() {
let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
unsafe {
assert_eq!(libc::pthread_rwlock_wrlock(rw.get()), 0);
libc::pthread_rwlock_destroy(rw.get()); //~ ERROR: destroyed a locked rwlock
2020-04-05 14:55:57 -05:00
}
}