summaryrefslogtreecommitdiffstats
path: root/src/test/ui/threads-sendsync/issue-4446.rs
blob: 948f2a7bdf31cc63c70e8f87d12b3e4470599916 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// run-pass
// ignore-emscripten no threads support

use std::sync::mpsc::channel;
use std::thread;

pub fn main() {
    let (tx, rx) = channel();

    tx.send("hello, world").unwrap();

    thread::spawn(move|| {
        println!("{}", rx.recv().unwrap());
    }).join().ok().unwrap();
}