rust/tests/compile-fail/concurrency/libc_pthread_join_self.rs
2020-04-27 14:26:36 -07:00

17 lines
384 B
Rust

// ignore-windows: Concurrency on Windows is not supported yet.
// Joining itself is undefined behavior.
#![feature(rustc_private)]
extern crate libc;
use std::ptr;
fn main() {
unsafe {
let native: libc::pthread_t = libc::pthread_self();
assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0); //~ ERROR: Undefined Behavior: trying to join itself
}
}