about summary refs log tree commit diff
path: root/tests/ui/threads-sendsync/yield1.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/threads-sendsync/yield1.rs')
-rw-r--r--tests/ui/threads-sendsync/yield1.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/threads-sendsync/yield1.rs b/tests/ui/threads-sendsync/yield1.rs
new file mode 100644
index 00000000000..002e590550c
--- /dev/null
+++ b/tests/ui/threads-sendsync/yield1.rs
@@ -0,0 +1,16 @@
+// run-pass
+
+#![allow(unused_must_use)]
+#![allow(unused_mut)]
+// ignore-emscripten no threads support
+
+use std::thread;
+
+pub fn main() {
+    let mut result = thread::spawn(child);
+    println!("1");
+    thread::yield_now();
+    result.join();
+}
+
+fn child() { println!("2"); }