< prev index next >

src/java.base/windows/classes/sun/nio/ch/NativeThread.java

Print this page

        

*** 26,42 **** package sun.nio.ch; // Signalling operations on native threads class NativeThread { static long current() { ! // return 0 to ensure that async close of blocking sockets will close ! // the underlying socket. return 0; } ! static void signal(long nt) { } } --- 26,61 ---- package sun.nio.ch; // Signalling operations on native threads + import jdk.internal.misc.Strands; class NativeThread { + private static final long FIBER_ID = -1L; static long current() { ! Object s = Strands.currentStrand(); ! if (s instanceof Fiber) { ! return FIBER_ID; ! } else { ! return 0; ! } ! } ! ! static long currentKernelThread() { return 0; } ! static void signal(long tid) { ! throw new UnsupportedOperationException(); ! } ! ! static boolean isFiber(long tid) { ! return (tid == FIBER_ID); ! } ! ! static boolean isKernelThread(long tid) { ! return false; ! } }
< prev index next >