commit 7f633e190403627b49767570065ed82cb586e7fb
parent 3d6bd9cfb30056093a156b4a276603e240a39c15
Author: Markus Stange <mstange.moz@gmail.com>
Date: Mon, 20 Oct 2025 15:56:58 +0000
Bug 1886944 - Remove invalid calls to profiler_thread_sleep/wake from our CFRunLoop observer. r=canaltinova
Unfortunately there can be work happening between the "BeforeWaiting" and the
next notification. For example, another observer's "BeforeWaiting" notification
could do some CPU work that we want to be able to sample.
Specifically, CATransaction auto-commit appears to happen from such a
"BeforeWaiting" observer. So if we do some main thread painting during
the CATransaction commit, which involves a sync IPC call, the mutex guard
during the sync IPC call may call profiler_thread_sleep again, and we have
assertions which complain about these double-sleeps.
Differential Revision: https://phabricator.services.mozilla.com/D268800
Diffstat:
1 file changed, 0 insertions(+), 2 deletions(-)
diff --git a/widget/cocoa/nsAppShell.mm b/widget/cocoa/nsAppShell.mm
@@ -337,13 +337,11 @@ void nsAppShell::OnRunLoopActivityChanged(CFRunLoopActivity aActivity) {
profilingStack.pushLabelFrame("Native event loop idle", nullptr,
&variableOnStack,
JS::ProfilingCategoryPair::IDLE, 0);
- profiler_thread_sleep();
});
} else {
if (mProfilingStackWhileWaiting) {
mProfilingStackWhileWaiting->pop();
mProfilingStackWhileWaiting = nullptr;
- profiler_thread_wake();
}
}
}