Skip to content

Commit

Permalink
Merge pull request #18988 from singh264/openj9_issues_18556_for_v0.44…
Browse files Browse the repository at this point in the history
….0-release

(0.44) Fix intermittent LogGeneratedClassesTest failures
  • Loading branch information
tajila authored Feb 23, 2024
2 parents da2c022 + 63826d4 commit 2decc4b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ private static native void checkpointJVMImpl(String imageDir,

private static native String[] getRestoreSystemProperites();

static {
private static void initializeUnsafe() {
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
try {
Field f = Unsafe.class.getDeclaredField("theUnsafe"); //$NON-NLS-1$
Expand Down Expand Up @@ -809,6 +809,10 @@ private void registerRestoreEnvVariables() {
return;
}

if (unsafe == null) {
initializeUnsafe();
}

J9InternalCheckpointHookAPI.registerPostRestoreHook(HookMode.SINGLE_THREAD_MODE, RESTORE_ENVIRONMENT_VARIABLES_PRIORITY,
"Restore environment variables via env file: " + envFile, () -> { //$NON-NLS-1$
if (!Files.exists(this.envFile)) {
Expand Down

0 comments on commit 2decc4b

Please sign in to comment.