--- a/src/hotspot/os/posix/semaphore_posix.cpp Wed Jan 23 14:10:31 2019 -0800
+++ b/src/hotspot/os/posix/semaphore_posix.cpp Wed Jan 23 21:17:51 2019 -0500
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -79,6 +79,12 @@
return ret == 0;
}
+bool PosixSemaphore::timedwait(int64_t millis) {
+ struct timespec ts;
+ os::Posix::to_RTC_abstime(&ts, millis);
+ return timedwait(ts);
+}
+
bool PosixSemaphore::timedwait(struct timespec ts) {
while (true) {
int result = sem_timedwait(&_semaphore, &ts);