Skip to content

Commit 8c28f25

Browse files
author
Brian Burkhalter
committed
8337124: (fs) sun.nio.fs.WindowsSecurity.enablePrivilege should pin when continuations supported
Reviewed-by: jpai, alanb
1 parent b5b5a5b commit 8c28f25

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/java.base/windows/classes/sun/nio/fs/WindowsSecurity.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
2525

2626
package sun.nio.fs;
2727

28-
import jdk.internal.misc.PreviewFeatures;
2928
import jdk.internal.vm.Continuation;
29+
import jdk.internal.vm.ContinuationSupport;
3030

3131
import static sun.nio.fs.WindowsNativeDispatcher.*;
3232
import static sun.nio.fs.WindowsConstants.*;
@@ -106,7 +106,7 @@ static Privilege enablePrivilege(String priv) {
106106
final boolean needToRevert = elevated;
107107

108108
// prevent yielding with privileges
109-
if (PreviewFeatures.isEnabled())
109+
if (ContinuationSupport.isSupported())
110110
Continuation.pin();
111111

112112
return () -> {
@@ -126,7 +126,7 @@ else if (needToRevert)
126126
}
127127
} finally {
128128
LocalFree(pLuid);
129-
if (PreviewFeatures.isEnabled())
129+
if (ContinuationSupport.isSupported())
130130
Continuation.unpin();
131131
}
132132
};

0 commit comments

Comments
 (0)