src/hotspot/os/posix/os_posix.cpp
changeset 53077 33b8f6f4cdf5
parent 52585 f7f90fddce02
child 53266 57d8566a2732
--- a/src/hotspot/os/posix/os_posix.cpp	Thu Dec 20 02:51:01 2018 +0100
+++ b/src/hotspot/os/posix/os_posix.cpp	Thu Dec 20 10:05:19 2018 +0100
@@ -695,6 +695,21 @@
   }
 }
 
+void os::naked_short_nanosleep(jlong ns) {
+  struct timespec req;
+  assert(ns > -1 && ns < NANOUNITS, "Un-interruptable sleep, short time use only");
+  req.tv_sec = 0;
+  req.tv_nsec = ns;
+  ::nanosleep(&req, NULL);
+  return;
+}
+
+void os::naked_short_sleep(jlong ms) {
+  assert(ms < MILLIUNITS, "Un-interruptable sleep, short time use only");
+  os::naked_short_nanosleep(ms * (NANOUNITS / MILLIUNITS));
+  return;
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 // interrupt support