How to check if a thread has finished in Rust?

前端 未结 4 906
情书的邮戳
情书的邮戳 2020-12-18 19:18

When I spawn a thread in Rust, I get a JoinHandle, which is good for... joining (a blocking operation), and not much else. How can I check if a ch

4条回答
  •  北海茫月
    2020-12-18 19:44

    I think Arc can be used to solve this problem If the thread exits, the reference counter is reduced by one

提交回复
热议问题