src/java.base/share/classes/sun/nio/fs/Cancellable.java
Print this page
@@ -23,11 +23,10 @@
* questions.
*/
package sun.nio.fs;
-import sun.misc.ManagedLocalsThread;
import jdk.internal.misc.Unsafe;
import java.util.concurrent.ExecutionException;
/**
* Base implementation of a task (typically native) that polls a memory location
@@ -116,11 +115,11 @@
* Invokes the given task in its own thread. If this (meaning the current)
* thread is interrupted then an attempt is make to cancel the background
* thread by writing into the memory location that it polls cooperatively.
*/
static void runInterruptibly(Cancellable task) throws ExecutionException {
- Thread t = new ManagedLocalsThread(task);
+ Thread t = new Thread(null, task, "NIO-Task", 0, false);
t.start();
boolean cancelledByInterrupt = false;
while (t.isAlive()) {
try {
t.join();