We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cb14269 commit 5e7f641Copy full SHA for 5e7f641
library/std/src/sys_common/thread_info.rs
@@ -39,6 +39,9 @@ pub fn stack_guard() -> Option<Guard> {
39
}
40
41
pub fn set(stack_guard: Option<Guard>, thread: Thread) {
42
- THREAD_INFO.with(|c| rtassert!(c.borrow().is_none()));
43
- THREAD_INFO.with(move |c| *c.borrow_mut() = Some(ThreadInfo { stack_guard, thread }));
+ THREAD_INFO.with(move |thread_info| {
+ let mut thread_info = thread_info.borrow_mut();
44
+ rtassert!(thread_info.is_none());
45
+ *thread_info = Some(ThreadInfo { stack_guard, thread });
46
+ });
47
0 commit comments