Skip to content

Commit

Permalink
handle the case of set_current_task_id being called after CONTEXT is …
Browse files Browse the repository at this point in the history
…destroyed
  • Loading branch information
agayev committed Nov 9, 2022
1 parent b6cae2e commit a6b34b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tokio/src/runtime/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ cfg_rt! {
pub(crate) struct DisallowBlockInPlaceGuard(bool);

pub(crate) fn set_current_task_id(id: Option<Id>) {
CONTEXT.with(|ctx| ctx.current_task_id.replace(id));
let _ = CONTEXT.try_with(|ctx| ctx.current_task_id.replace(id));
}

#[track_caller]
Expand Down

0 comments on commit a6b34b9

Please sign in to comment.