Mercurial > hg > icedtea7-forest > hotspot
changeset 6496:5f801a6bfcfd
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
author | goetz |
---|---|
date | Wed, 19 Feb 2014 14:03:09 -0800 |
parents | 2197bb9f9d14 |
children | e806d32ca07a |
files | src/os/aix/vm/os_aix.cpp |
diffstat | 1 files changed, 15 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/os/aix/vm/os_aix.cpp Tue May 19 11:06:34 2015 +0200 +++ b/src/os/aix/vm/os_aix.cpp Wed Feb 19 14:03:09 2014 -0800 @@ -2885,9 +2885,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