mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8337124: (fs) sun.nio.fs.WindowsSecurity.enablePrivilege should pin when continuations supported
Reviewed-by: jpai, alanb
This commit is contained in:
parent
b5b5a5b8e5
commit
8c28f25e13
1 changed files with 4 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2024, 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
|
||||
|
@ -25,8 +25,8 @@
|
|||
|
||||
package sun.nio.fs;
|
||||
|
||||
import jdk.internal.misc.PreviewFeatures;
|
||||
import jdk.internal.vm.Continuation;
|
||||
import jdk.internal.vm.ContinuationSupport;
|
||||
|
||||
import static sun.nio.fs.WindowsNativeDispatcher.*;
|
||||
import static sun.nio.fs.WindowsConstants.*;
|
||||
|
@ -106,7 +106,7 @@ class WindowsSecurity {
|
|||
final boolean needToRevert = elevated;
|
||||
|
||||
// prevent yielding with privileges
|
||||
if (PreviewFeatures.isEnabled())
|
||||
if (ContinuationSupport.isSupported())
|
||||
Continuation.pin();
|
||||
|
||||
return () -> {
|
||||
|
@ -126,7 +126,7 @@ class WindowsSecurity {
|
|||
}
|
||||
} finally {
|
||||
LocalFree(pLuid);
|
||||
if (PreviewFeatures.isEnabled())
|
||||
if (ContinuationSupport.isSupported())
|
||||
Continuation.unpin();
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue