src/java.base/share/classes/sun/nio/fs/Cancellable.java

Print this page

        

*** 23,33 **** * 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 --- 23,32 ----
*** 116,126 **** * 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); t.start(); boolean cancelledByInterrupt = false; while (t.isAlive()) { try { t.join(); --- 115,125 ---- * 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 Thread(null, task, "NIO-Task", 0, false); t.start(); boolean cancelledByInterrupt = false; while (t.isAlive()) { try { t.join();