diff options
Diffstat (limited to 'js/src/vm/InternalThreadPool.cpp')
-rw-r--r-- | js/src/vm/InternalThreadPool.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/js/src/vm/InternalThreadPool.cpp b/js/src/vm/InternalThreadPool.cpp index 483e995254..c6cdac1d44 100644 --- a/js/src/vm/InternalThreadPool.cpp +++ b/js/src/vm/InternalThreadPool.cpp @@ -187,7 +187,10 @@ void InternalThreadPool::DispatchTask(JS::DispatchReason reason) { } void InternalThreadPool::dispatchTask(JS::DispatchReason reason) { - gHelperThreadLock.assertOwnedByCurrentThread(); + // This could now use a separate mutex like TaskController, but continues to + // use the helper thread state lock for convenience. + AutoLockHelperThreadState lock; + queuedTasks++; if (reason == JS::DispatchReason::NewTask) { wakeup.notify_one(); @@ -279,7 +282,9 @@ void HelperThread::threadLoop(InternalThreadPool* pool) { while (!pool->terminating) { if (pool->queuedTasks != 0) { pool->queuedTasks--; - HelperThreadState().runOneTask(lock); + + AutoUnlockHelperThreadState unlock(lock); + JS::RunHelperThreadTask(); continue; } |