comparison src/os/aix/vm/os_aix.cpp @ 17811:941427282eae

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 71a71b0bc844
children 6048424d3865
comparison
equal deleted inserted replaced
17810:62c54fcc0a35 17811:941427282eae
2896 } 2896 }
2897 return OS_OK; 2897 return OS_OK;
2898 } 2898 }
2899 } 2899 }
2900 2900
2901 int os::naked_sleep() { 2901 void os::naked_short_sleep(jlong ms) {
2902 // %% make the sleep time an integer flag. for now use 1 millisec. 2902 struct timespec req;
2903 return os::sleep(Thread::current(), 1, false); 2903
2904 assert(ms < 1000, "Un-interruptable sleep, short time use only");
2905 req.tv_sec = 0;
2906 if (ms > 0) {
2907 req.tv_nsec = (ms % 1000) * 1000000;
2908 }
2909 else {
2910 req.tv_nsec = 1;
2911 }
2912
2913 nanosleep(&req, NULL);
2914
2915 return;
2904 } 2916 }
2905 2917
2906 // Sleep forever; naked call to OS-specific sleep; use with CAUTION 2918 // Sleep forever; naked call to OS-specific sleep; use with CAUTION
2907 void os::infinite_sleep() { 2919 void os::infinite_sleep() {
2908 while (true) { // sleep forever ... 2920 while (true) { // sleep forever ...