Bug 1821250 - Use a timer on debugger control runnable to ensure running them even if worker uses Atomics.wait. r=asuth
Atomics.wait prevent WorkerDebuggerRunnable's from running by blocking the event loop. While dispatching these runnables, also spawn a short timer which would interrupt the worker and tentatively try to drain the debugger queue and resume any debugger runnable which may be blocked. Differential Revision: https://phabricator.services.mozilla.com/D194081
This commit is contained in:
@@ -449,14 +449,14 @@ void LoadJSGCMemoryOptions(const char* aPrefName, void* /* aClosure */) {
|
||||
}
|
||||
}
|
||||
|
||||
bool InterruptCallback(JSContext* aCx) {
|
||||
MOZ_CAN_RUN_SCRIPT bool InterruptCallback(JSContext* aCx) {
|
||||
WorkerPrivate* worker = GetWorkerPrivateFromContext(aCx);
|
||||
MOZ_ASSERT(worker);
|
||||
|
||||
// Now is a good time to turn on profiling if it's pending.
|
||||
PROFILER_JS_INTERRUPT_CALLBACK();
|
||||
|
||||
return worker->InterruptCallback(aCx);
|
||||
return MOZ_KnownLive(worker)->InterruptCallback(aCx);
|
||||
}
|
||||
|
||||
class LogViolationDetailsRunnable final : public WorkerMainThreadRunnable {
|
||||
|
||||
Reference in New Issue
Block a user