Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
threads-sendsync
/
issue-4446.rs
blob: 5652ad7de55b57b10efe80c432137e7f67fda23c [
file
] [
log
] [
blame
] [
edit
]
//@ run-pass
//@ needs-threads
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
();
}