Use usleep instead of sleep(0).
sleep(0) is unfortunately not specified.
Change-Id: I5e9c626d21a562ca04329c0cc039a1f3a71dfc84
diff --git a/test/570-checker-osr/osr.cc b/test/570-checker-osr/osr.cc
index 2fa5800..cf413ba 100644
--- a/test/570-checker-osr/osr.cc
+++ b/test/570-checker-osr/osr.cc
@@ -136,7 +136,7 @@
if (m_name.compare(method_name_) == 0) {
while (jit->GetCodeCache()->LookupOsrMethodHeader(m) == nullptr) {
// Sleep to yield to the compiler thread.
- sleep(0);
+ usleep(1000);
// Will either ensure it's compiled or do the compilation itself.
jit->CompileMethod(m, Thread::Current(), /* osr */ true);
}
diff --git a/test/604-hot-static-interface/hot_static_interface.cc b/test/604-hot-static-interface/hot_static_interface.cc
index 71877f5..9074a0a 100644
--- a/test/604-hot-static-interface/hot_static_interface.cc
+++ b/test/604-hot-static-interface/hot_static_interface.cc
@@ -49,7 +49,7 @@
break;
} else {
// Sleep to yield to the compiler thread.
- sleep(0);
+ usleep(1000);
// Will either ensure it's compiled or do the compilation itself.
jit->CompileMethod(method, Thread::Current(), /* osr */ false);
}