# HG changeset patch # User goetz # Date 1392847389 28800 # Node ID 121e3c2d22389cb757a96c849a31923ab8fbb52d # Parent 57aa8995d43b825061491ce187309f61e7db6d19 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 diff -r 57aa8995d43b -r 121e3c2d2238 hotspot/src/os/aix/vm/os_aix.cpp --- a/hotspot/src/os/aix/vm/os_aix.cpp Wed Feb 19 12:08:49 2014 -0800 +++ b/hotspot/src/os/aix/vm/os_aix.cpp Wed Feb 19 14:03:09 2014 -0800 @@ -2894,9 +2894,21 @@ } } -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