blob: 41b26c84393d21875a8a87ea45f4561331694ce8 [file] [log] [blame]
//@only-target: windows # Uses win32 api functions
// We are making scheduler assumptions here.
//@compile-flags: -Zmiri-deterministic-concurrency
use std::os::windows::io::IntoRawHandle;
use std::thread;
use windows_sys::Win32::Foundation::{CloseHandle, HANDLE};
fn main() {
let thread = thread::spawn(|| {}).into_raw_handle() as HANDLE;
// this yield ensures that `thread` is terminated by this point
thread::yield_now();
unsafe {
assert_ne!(CloseHandle(thread), 0);
}
}