summaryrefslogtreecommitdiffstats
path: root/libjava/include/win32.h
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-31 17:43:47 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-31 17:43:47 +0000
commit890223f40b9318c390bf3a65c5ebfb6fcf31f235 (patch)
tree7796256b482af303f3dd8700910237614d8d6601 /libjava/include/win32.h
parentbe1ee46ec321e89ec39953bc28ec00ddaa195a33 (diff)
downloadppe42-gcc-890223f40b9318c390bf3a65c5ebfb6fcf31f235.tar.gz
ppe42-gcc-890223f40b9318c390bf3a65c5ebfb6fcf31f235.zip
2002-12-31 Tom Tromey <tromey@redhat.com>
Ranjit Mathew <rmathew@hotmail.com> Fix for PR libgcj/8997: * java/lang/natObject.cc (spin): Use _Jv_platform_usleep. Include platform.h. * include/posix.h (_Jv_platform_usleep): New function. * include/win32.h (_Jv_platform_usleep): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60700 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/include/win32.h')
-rw-r--r--libjava/include/win32.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/libjava/include/win32.h b/libjava/include/win32.h
index d4c0ab6c18d..8ba6ef2053c 100644
--- a/libjava/include/win32.h
+++ b/libjava/include/win32.h
@@ -48,6 +48,19 @@ _Jv_platform_close_on_exec (jint)
// Ignore.
}
+/* Suspends the execution of the current thread for the specified
+ number of microseconds. Tries to emulate the behaviour of usleep()
+ on UNIX and provides a granularity of 1 millisecond. */
+inline void
+_Jv_platform_usleep (unsigned long usecs)
+{
+ if (usecs > 0UL)
+ {
+ unsigned long millis = ((usecs + 999UL) / 1000UL);
+ Sleep (millis);
+ }
+}
+
#ifndef DISABLE_JAVA_NET
static inline int
OpenPOWER on IntegriCloud