rust/tests/compile-fail/sync/libc_pthread_rwlock_destroy_read_locked.rs
2020-04-11 11:36:55 +02:00

14 lines
341 B
Rust

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