We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66d19a2 commit d420f85Copy full SHA for d420f85
tests/pass/concurrency/windows_detach_terminated.rs
@@ -0,0 +1,21 @@
1
+//@only-target-windows: Uses win32 api functions
2
+// We are making scheduler assumptions here.
3
+//@compile-flags: -Zmiri-preemption-rate=0
4
+
5
+use std::os::windows::io::IntoRawHandle;
6
+use std::thread;
7
8
+extern "system" {
9
+ fn CloseHandle(handle: usize) -> i32;
10
+}
11
12
+fn main() {
13
+ let thread = thread::spawn(|| {}).into_raw_handle() as usize;
14
15
+ // this yield ensures that `thread` is terminated by this point
16
+ thread::yield_now();
17
18
+ unsafe {
19
+ assert_ne!(CloseHandle(thread), 0);
20
+ }
21
0 commit comments