Skip to content

Commit d674a68

Browse files
committed
src: fix platform shutdown deadlock
Each worker is signalling its own completion of tasks independently and so should only be signalling for one corresponding drain otherwise the count of outstanding tasks goes out of sync and the process will never stop waiting for tasks when it should be exiting. It just needs to be calling Signal rather than Broadcast.
1 parent 304bb9c commit d674a68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_platform.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ template <class T>
629629
void TaskQueue<T>::NotifyOfCompletion() {
630630
Mutex::ScopedLock scoped_lock(lock_);
631631
if (--outstanding_tasks_ == 0) {
632-
tasks_drained_.Broadcast(scoped_lock);
632+
tasks_drained_.Signal(scoped_lock);
633633
}
634634
}
635635

0 commit comments

Comments
 (0)