summaryrefslogtreecommitdiffstats
path: root/js/src/gc/GCParallelTask.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/gc/GCParallelTask.cpp')
-rw-r--r--js/src/gc/GCParallelTask.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/js/src/gc/GCParallelTask.cpp b/js/src/gc/GCParallelTask.cpp
index 27cb39df36..f33174ea2e 100644
--- a/js/src/gc/GCParallelTask.cpp
+++ b/js/src/gc/GCParallelTask.cpp
@@ -100,6 +100,12 @@ void js::GCParallelTask::joinWithLockHeld(AutoLockHelperThreadState& lock,
return;
}
+ if (lock.hasQueuedTasks()) {
+ // Unlock to allow task dispatch without lock held, otherwise we could wait
+ // forever.
+ AutoUnlockHelperThreadState unlock(lock);
+ }
+
if (isNotYetRunning(lock) && deadline.isNothing()) {
// If the task was dispatched but has not yet started then cancel the task
// and run it from the main thread. This stops us from blocking here when