Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
src: spin shutdown loop while immediates are pending
This allows using `SetImmediate()` and friends at any point
during cleanup.
  • Loading branch information
addaleax committed Aug 7, 2020
commit 60941d60650e2707cff5c995a2e81bdc1b7ac59a
5 changes: 4 additions & 1 deletion src/env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,10 @@ void Environment::RunCleanup() {
initial_base_object_count_ = 0;
CleanupHandles();

while (!cleanup_hooks_.empty()) {
while (!cleanup_hooks_.empty() ||
native_immediates_.size() > 0 ||
native_immediates_threadsafe_.size() > 0 ||
native_immediates_interrupts_.size() > 0) {
// Copy into a vector, since we can't sort an unordered_set in-place.
std::vector<CleanupHookCallback> callbacks(
cleanup_hooks_.begin(), cleanup_hooks_.end());
Expand Down