Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions stdlib/public/Concurrency/Task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1792,9 +1792,11 @@ static void swift_task_removeCancellationHandlerImpl(
return;
}

auto task = swift_task_getCurrent();
assert(task->_private()._status().load(std::memory_order_relaxed).getInnermostRecord() == record &&
"We expect that the popped record will be exactly first as well as that it is of the expected type");
if (auto poppedRecord =
popStatusRecordOfType<CancellationNotificationStatusRecord>(swift_task_getCurrent())) {
assert(record == poppedRecord && "The removed record did not match the expected record!");
popStatusRecordOfType<CancellationNotificationStatusRecord>(task)) {
swift_task_dealloc(record);
}
}
Expand Down