We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Thread::join
1 parent bb2cc59 commit 006ee13Copy full SHA for 006ee13
library/std/src/thread/mod.rs
@@ -1739,7 +1739,11 @@ struct JoinInner<'scope, T> {
1739
impl<'scope, T> JoinInner<'scope, T> {
1740
fn join(mut self) -> Result<T> {
1741
self.native.join();
1742
- Arc::get_mut(&mut self.packet).unwrap().result.get_mut().take().unwrap()
+ if let Some(packet) = Arc::get_mut(&mut self.packet) {
1743
+ packet.result.get_mut().take().unwrap()
1744
+ } else {
1745
+ Err(Box::new("thread terminated unexpectedly (e.g. due to OS intervention)"))
1746
+ }
1747
}
1748
1749
0 commit comments