--- a/hotspot/src/os/windows/vm/os_windows.cpp Mon Jul 03 14:24:07 2017 +0200
+++ b/hotspot/src/os/windows/vm/os_windows.cpp Fri Jun 30 10:36:32 2017 +0200
@@ -1940,6 +1940,12 @@
assert(ret == WAIT_OBJECT_0, "WaitForSingleObject failed with return value: %lu", ret);
}
+bool WindowsSemaphore::trywait() {
+ DWORD ret = ::WaitForSingleObject(_semaphore, 0);
+ assert(ret != WAIT_FAILED, "WaitForSingleObject failed with error code: %lu", GetLastError());
+ return ret == WAIT_OBJECT_0;
+}
+
// sun.misc.Signal
// NOTE that this is a workaround for an apparent kernel bug where if
// a signal handler for SIGBREAK is installed then that signal handler