Skip to content

Commit c677de3

Browse files
authored
fix: solve tls drop panic when task queue drop (#257)
1 parent a1ce0ef commit c677de3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

monoio/src/task/harness.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ where
180180
ctx.unpark_thread(owner_id);
181181
}
182182
None => {
183-
crate::runtime::DEFAULT_CTX.with(|default_ctx| {
183+
let _ = crate::runtime::DEFAULT_CTX.try_with(|default_ctx| {
184184
crate::runtime::CURRENT.set(default_ctx, || {
185185
crate::runtime::CURRENT.with(|ctx| {
186186
ctx.send_waker(owner_id, waker);
@@ -237,7 +237,7 @@ where
237237
ctx.unpark_thread(owner_id);
238238
}
239239
None => {
240-
crate::runtime::DEFAULT_CTX.with(|default_ctx| {
240+
let _ = crate::runtime::DEFAULT_CTX.try_with(|default_ctx| {
241241
crate::runtime::CURRENT.set(default_ctx, || {
242242
crate::runtime::CURRENT.with(|ctx| {
243243
ctx.send_waker(owner_id, waker);

0 commit comments

Comments
 (0)