diff --git a/closed/custom/modules/java.base/Lib.gmk b/closed/custom/modules/java.base/Lib.gmk index c59bd09d7a4..b2994b1e2d5 100644 --- a/closed/custom/modules/java.base/Lib.gmk +++ b/closed/custom/modules/java.base/Lib.gmk @@ -1,5 +1,5 @@ # =========================================================================== -# (c) Copyright IBM Corp. 2018, 2020 All Rights Reserved +# (c) Copyright IBM Corp. 2018, 2023 All Rights Reserved # =========================================================================== # This code is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 only, as @@ -18,24 +18,17 @@ # 2 along with this work; if not, see . # =========================================================================== -################################################################################ # Create the Java Native crypto library ifeq ($(WITH_OPENSSL), yes) $(eval $(call SetupJdkLibrary, BUILD_JNCRYPTO, \ NAME := jncrypto, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) \ - -c $(OPENSSL_CFLAGS), \ + CFLAGS := $(CFLAGS_JDKLIB) $(OPENSSL_CFLAGS), \ DISABLED_WARNINGS_gcc := sign-compare implicit-fallthrough unused-value, \ DISABLED_WARNINGS_clang := sign-compare, \ DISABLED_WARNINGS_microsoft := 4101 4244 4146 4018, \ - LDFLAGS := $(LDFLAGS_JDKLIB) \ - $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \ LIBS_unix := $(LIBDL), \ )) TARGETS += $(BUILD_JNCRYPTO) endif - -INCLUDE_CUSTOM_EXTENSION_SYMBOLS := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)jncrypto.symbols -INCLUDE_CUSTOM_EXTENSION_LIB := BUILD_JNCRYPTO -################################################################################ diff --git a/src/java.base/share/classes/java/lang/Thread.java b/src/java.base/share/classes/java/lang/Thread.java index 8caa3b6a9ee..b99ac1f14a5 100644 --- a/src/java.base/share/classes/java/lang/Thread.java +++ b/src/java.base/share/classes/java/lang/Thread.java @@ -1627,32 +1627,35 @@ void clearReferences() { * a chance to clean up before it actually exits. */ void exit() { - /* Refresh interrupted value so it is accurate when thread reference is removed. */ - interrupted = interrupted(); - try { - // pop any remaining scopes from the stack, this may block - if (headStackableScopes != null) { - StackableScope.popAll(); - } - } finally { - // notify container that thread is exiting - ThreadContainer container = threadContainer(); - if (container != null) { - container.onExit(this); + /* Refresh interrupted value so it is accurate when thread reference is removed. */ + interrupted = interrupted(); + + try { + // pop any remaining scopes from the stack, this may block + if (headStackableScopes != null) { + StackableScope.popAll(); + } + } finally { + // notify container that thread is exiting + ThreadContainer container = threadContainer(); + if (container != null) { + container.onExit(this); + } } - } - try { - if (threadLocals != null && TerminatingThreadLocal.REGISTRY.isPresent()) { - TerminatingThreadLocal.threadTerminated(); + try { + if (threadLocals != null && TerminatingThreadLocal.REGISTRY.isPresent()) { + TerminatingThreadLocal.threadTerminated(); + } + } finally { + clearReferences(); } } finally { - clearReferences(); - } - synchronized (interruptLock) { - // so that isAlive() can work - eetop = Thread.NO_REF; + synchronized (interruptLock) { + // so that isAlive() can work + eetop = Thread.NO_REF; + } } } diff --git a/src/java.base/share/classes/java/util/Timer.java b/src/java.base/share/classes/java/util/Timer.java index f29e1955bfc..a78ac662d38 100644 --- a/src/java.base/share/classes/java/util/Timer.java +++ b/src/java.base/share/classes/java/util/Timer.java @@ -588,7 +588,9 @@ private void mainLoop() { // A zero checkpointRestoreTimeDelta value indicates no Checkpoint performed yet, // it can't be negative, otherwise a RestoreException already was thrown. if (checkpointRestoreTimeDelta > 0) { + // Ensure the time compensation in milliseconds is not less than the checkpoint restore time delta. task.nextExecutionTime += (checkpointRestoreTimeDelta / 1000000); + task.nextExecutionTime += ((checkpointRestoreTimeDelta % 1000000 == 0) ? 0 : 1); // clear the flag - only one time adjustment required task.criuAdjustRequired = false; } diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/riscv64/RISCV64Architecture.java b/src/java.base/share/classes/jdk/internal/foreign/abi/riscv64/RISCV64Architecture.java index 594a8b31119..9c3d64be7ad 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/abi/riscv64/RISCV64Architecture.java +++ b/src/java.base/share/classes/jdk/internal/foreign/abi/riscv64/RISCV64Architecture.java @@ -6,7 +6,9 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/riscv64/linux/LinuxRISCV64CallArranger.java b/src/java.base/share/classes/jdk/internal/foreign/abi/riscv64/linux/LinuxRISCV64CallArranger.java index 595d3d0aed2..e8b33345dcb 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/abi/riscv64/linux/LinuxRISCV64CallArranger.java +++ b/src/java.base/share/classes/jdk/internal/foreign/abi/riscv64/linux/LinuxRISCV64CallArranger.java @@ -6,7 +6,9 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/riscv64/linux/LinuxRISCV64Linker.java b/src/java.base/share/classes/jdk/internal/foreign/abi/riscv64/linux/LinuxRISCV64Linker.java index 0ffba55d929..a6593979e99 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/abi/riscv64/linux/LinuxRISCV64Linker.java +++ b/src/java.base/share/classes/jdk/internal/foreign/abi/riscv64/linux/LinuxRISCV64Linker.java @@ -6,7 +6,9 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/riscv64/linux/TypeClass.java b/src/java.base/share/classes/jdk/internal/foreign/abi/riscv64/linux/TypeClass.java index 368a7571beb..380f0a83109 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/abi/riscv64/linux/TypeClass.java +++ b/src/java.base/share/classes/jdk/internal/foreign/abi/riscv64/linux/TypeClass.java @@ -6,7 +6,9 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or