diff options
Diffstat (limited to 'tests/ui/threads-sendsync/yield2.rs')
-rw-r--r-- | tests/ui/threads-sendsync/yield2.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/threads-sendsync/yield2.rs b/tests/ui/threads-sendsync/yield2.rs new file mode 100644 index 000000000..376faab0c --- /dev/null +++ b/tests/ui/threads-sendsync/yield2.rs @@ -0,0 +1,8 @@ +// run-pass + +use std::thread; + +pub fn main() { + let mut i: isize = 0; + while i < 100 { i = i + 1; println!("{}", i); thread::yield_now(); } +} |