Adjust JIT thread priority post-fork.
Bug: 166406877
Test: test.py
Change-Id: I81c9a231213e62a1aeaa67cfe8c38419f5bddcd0
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 7b907cc..95c40b4 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -685,8 +685,14 @@
}
void Runtime::PostZygoteFork() {
- if (GetJit() != nullptr) {
- GetJit()->PostZygoteFork();
+ jit::Jit* jit = GetJit();
+ if (jit != nullptr) {
+ jit->PostZygoteFork();
+ // Ensure that the threads in the JIT pool have been created with the right
+ // priority.
+ if (kIsDebugBuild && jit->GetThreadPool() != nullptr) {
+ jit->GetThreadPool()->CheckPthreadPriority(jit->GetThreadPoolPthreadPriority());
+ }
}
// Reset all stats.
ResetStats(0xFFFFFFFF);