2022-07-17 20:54:10 -05:00
|
|
|
//@ignore-target-windows: No libc on Windows
|
2020-04-05 14:55:57 -05:00
|
|
|
|
|
|
|
#![feature(rustc_private)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
|
|
|
|
unsafe {
|
|
|
|
assert_eq!(libc::pthread_rwlock_rdlock(rw.get()), 0);
|
2022-07-11 06:44:55 -05:00
|
|
|
libc::pthread_rwlock_destroy(rw.get()); //~ ERROR: destroyed a locked rwlock
|
2020-04-05 14:55:57 -05:00
|
|
|
}
|
|
|
|
}
|