Skip to content

Commit

Permalink
Add diagnostics for mismatched queue cleanups (#763)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhackett1024 committed Jun 24, 2023
1 parent 4b33a3b commit 37c4108
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions base/task/sequence_manager/sequence_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1137,17 +1137,24 @@ void SequenceManagerImpl::ReclaimMemory() {
}

void SequenceManagerImpl::CleanUpQueues() {
recordreplay::Assert("[RUN-2217] SequenceManagerImpl::CleanUpQueues");

for (auto it = main_thread_only().queues_to_gracefully_shutdown.begin();
it != main_thread_only().queues_to_gracefully_shutdown.end();) {
recordreplay::Assert("[RUN-2217] SequenceManagerImpl::CleanUpQueues #1");
if (it->first->IsEmpty()) {
recordreplay::Assert("[RUN-2217] SequenceManagerImpl::CleanUpQueues #2");
UnregisterTaskQueueImpl(std::move(it->second));
main_thread_only().active_queues.erase(it->first);
main_thread_only().queues_to_gracefully_shutdown.erase(it++);
} else {
recordreplay::Assert("[RUN-2217] SequenceManagerImpl::CleanUpQueues #3");
++it;
}
}
main_thread_only().queues_to_delete.clear();

recordreplay::Assert("[RUN-2217] SequenceManagerImpl::CleanUpQueues Done");
}

void SequenceManagerImpl::RemoveAllCanceledTasksFromFrontOfWorkQueues() {
Expand Down

0 comments on commit 37c4108

Please sign in to comment.