Use sleep instead of sched_yield.
The compiler thread has a different priority than the main thread,
so there's no guarantee sched_yield will actually pass the CPU to
the compiler thread.
Change-Id: I7e8d3cbf478c482a9ba9502f7bba7fb1397cd28e
diff --git a/test/604-hot-static-interface/hot_static_interface.cc b/test/604-hot-static-interface/hot_static_interface.cc
index 21beae8..71877f5 100644
--- a/test/604-hot-static-interface/hot_static_interface.cc
+++ b/test/604-hot-static-interface/hot_static_interface.cc
@@ -48,8 +48,8 @@
if (code_cache->ContainsPc(header->GetCode())) {
break;
} else {
- // yield to scheduler to give time to the JIT compiler.
- sched_yield();
+ // Sleep to yield to the compiler thread.
+ sleep(0);
// Will either ensure it's compiled or do the compilation itself.
jit->CompileMethod(method, Thread::Current(), /* osr */ false);
}