提交 4a3b02bc 编写于 作者: G goetz

8034797: AIX: Fix os::naked_short_sleep() in os_aix.cpp after 8028280

Summary: imlements os::naked_short_sleep(jlong ms) on AIX
Reviewed-by: dholmes, kvn
上级 e1f463ac
......@@ -2898,9 +2898,21 @@ int os::sleep(Thread* thread, jlong millis, bool interruptible) {
}
}
int os::naked_sleep() {
// %% make the sleep time an integer flag. for now use 1 millisec.
return os::sleep(Thread::current(), 1, false);
void os::naked_short_sleep(jlong ms) {
struct timespec req;
assert(ms < 1000, "Un-interruptable sleep, short time use only");
req.tv_sec = 0;
if (ms > 0) {
req.tv_nsec = (ms % 1000) * 1000000;
}
else {
req.tv_nsec = 1;
}
nanosleep(&req, NULL);
return;
}
// Sleep forever; naked call to OS-specific sleep; use with CAUTION
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册