From 09eb67c228b35d8d6628615e618dc19336d76ec9 Mon Sep 17 00:00:00 2001 From: Axel Boldt-Christmas Date: Wed, 11 Feb 2026 13:50:34 +0000 Subject: [PATCH] Revert "OSX: Semaphore.trywait requires os::Bsd::clock_init" This reverts commit 64a843dbbee744bdc6c82c8fe8ccdbd3cf15abcd. --- test/hotspot/gtest/runtime/test_semaphore.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/test/hotspot/gtest/runtime/test_semaphore.cpp b/test/hotspot/gtest/runtime/test_semaphore.cpp index 06d38c6a623..2daa49d5885 100644 --- a/test/hotspot/gtest/runtime/test_semaphore.cpp +++ b/test/hotspot/gtest/runtime/test_semaphore.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2025, 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 @@ -22,7 +22,6 @@ */ #include "runtime/semaphore.hpp" -#include "runtime/os.inline.hpp" #include "unittest.hpp" static void test_semaphore_single_separate(uint count) { @@ -97,13 +96,6 @@ TEST(Semaphore, many) { } TEST(Semaphore, trywait) { -#ifdef __APPLE__ - // On __APPLE__ semaphore trywait uses os::javaTimeNanos() which requires the - // clock to be initialized. os::Bsd::clock_init() currently allows for multiple - // invocations, so this test is fine to run either before or after another VM - // gtest. - os::Bsd::clock_init(); -#endif // __APPLE__ for (uint max = 0; max < 10; max++) { for (uint value = 0; value < max; value++) { test_semaphore_trywait(value, max);