summaryrefslogtreecommitdiffstats
path: root/src/test/ui/threads-sendsync/yield1.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/threads-sendsync/yield1.rs')
-rw-r--r--src/test/ui/threads-sendsync/yield1.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/threads-sendsync/yield1.rs b/src/test/ui/threads-sendsync/yield1.rs
new file mode 100644
index 000000000..002e59055
--- /dev/null
+++ b/src/test/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"); }