hotspot/src/os/bsd/vm/os_bsd.cpp
changeset 22533 76088853a2eb
parent 22528 bd3821442010
child 22734 41757c1f3946
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp	Thu Jan 23 16:02:14 2014 -0500
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp	Fri Jan 24 09:28:47 2014 +0100
@@ -2636,9 +2636,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