authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-27 14:08:51-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-29 06:20:51-07:00
log0caf286a1a9f1f7fe13483d7adbf3f1357b12a1c
treec6a9589b0630b317a1b8cabb272dd17d7415ad80
parentdf4c30ca1631c26fce3bec1cba6a15a688745433

std.Io.Threaded: don't skip executing canceled group closures


1 files changed, 2 insertions(+), 4 deletions(-)

lib/std/Io/Threaded.zig+2-4
......@@ -566,10 +566,8 @@ const GroupClosure = struct {
566566 const reset_event: *ResetEvent = @ptrCast(&group.context);
567567 if (@cmpxchgStrong(CancelId, &closure.cancel_tid, .none, tid, .acq_rel, .acquire)) |cancel_tid| {
568568 assert(cancel_tid == .canceling);
569 // We already know the task is canceled before running the callback. Since all closures
570 // in a Group have void return type, we can return early.
571 syncFinish(group_state, reset_event);
572 return;
569 // Even though we already know the task is canceled, we must still
570 // run the closure in case there are side effects.
573571 }
574572 current_closure = closure;
575573 gc.func(group, gc.contextPointer());