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