Bug 1429847 - Promote the GraphRunner thread. r=pehrsons

Differential Revision: https://phabricator.services.mozilla.com/D32499

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Paul Adenot 2019-06-21 19:51:22 +00:00
parent 6af26dcc3d
commit 356d945008
2 changed files with 10 additions and 0 deletions

View File

@ -13,6 +13,7 @@
#include "nsISupportsImpl.h"
#include "prthread.h"
#include "Tracing.h"
#include "audio_thread_priority.h"
namespace mozilla {
@ -91,6 +92,10 @@ bool GraphRunner::OneIteration(GraphTime aStateEnd) {
void GraphRunner::Run() {
PR_SetCurrentThreadName("GraphRunner");
atp_handle* handle =
atp_promote_current_thread_to_real_time(0, mGraph->GraphRate());
MonitorAutoLock lock(mMonitor);
while (true) {
while (mThreadState == ThreadState::Wait) {
@ -106,6 +111,10 @@ void GraphRunner::Run() {
mMonitor.Notify();
}
if (handle) {
atp_demote_current_thread_from_real_time(handle);
}
dom::WorkletThread::DeleteCycleCollectedJSContext();
}

View File

@ -89,6 +89,7 @@ XPIDL_SOURCES += [
XPIDL_MODULE = 'dom_media'
EXPORTS += [
'../../third_party/rust/audio_thread_priority/audio_thread_priority.h',
'ADTSDecoder.h',
'ADTSDemuxer.h',
'AsyncLogger.h',