hotspot/src/os/windows/vm/os_windows.cpp
changeset 46610 d3e75e23b534
parent 46589 f1c04490ded1
child 46618 d503911aa948
--- 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