diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-10-27 14:08:51 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-10-29 06:20:51 -0700 |
| commit | 0caf286a1a9f1f7fe13483d7adbf3f1357b12a1c (patch) | |
| tree | c6a9589b0630b317a1b8cabb272dd17d7415ad80 /lib/std | |
| parent | df4c30ca1631c26fce3bec1cba6a15a688745433 (diff) | |
| download | zig-0caf286a1a9f1f7fe13483d7adbf3f1357b12a1c.tar.gz zig-0caf286a1a9f1f7fe13483d7adbf3f1357b12a1c.zip | |
std.Io.Threaded: don't skip executing canceled group closures
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/Io/Threaded.zig | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig index 2af24dbf17..2bb88cbb78 100644 --- a/lib/std/Io/Threaded.zig +++ b/lib/std/Io/Threaded.zig @@ -566,10 +566,8 @@ const GroupClosure = struct { const reset_event: *ResetEvent = @ptrCast(&group.context); if (@cmpxchgStrong(CancelId, &closure.cancel_tid, .none, tid, .acq_rel, .acquire)) |cancel_tid| { assert(cancel_tid == .canceling); - // We already know the task is canceled before running the callback. Since all closures - // in a Group have void return type, we can return early. - syncFinish(group_state, reset_event); - return; + // Even though we already know the task is canceled, we must still + // run the closure in case there are side effects. } current_closure = closure; gc.func(group, gc.contextPointer()); |
