src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java
changeset 49491 f7363de371c9
parent 47216 71c04702a3d5
child 52220 9c260a6b6471
equal deleted inserted replaced
49490:1bc4cd2c5f8b 49491:f7363de371c9
   410     }
   410     }
   411 
   411 
   412     /**
   412     /**
   413      * Returns the thread id for the given thread.  We must access
   413      * Returns the thread id for the given thread.  We must access
   414      * this directly rather than via method Thread.getId() because
   414      * this directly rather than via method Thread.getId() because
   415      * getId() is not final, and has been known to be overridden in
   415      * getId() has been known to be overridden in ways that do not
   416      * ways that do not preserve unique mappings.
   416      * preserve unique mappings.
   417      */
   417      */
   418     static final long getThreadId(Thread thread) {
   418     static final long getThreadId(Thread thread) {
   419         return U.getLongVolatile(thread, TID);
   419         return U.getLong(thread, TID);
   420     }
   420     }
   421 
   421 
   422     // Hotspot implementation via intrinsics API
   422     // Hotspot implementation via intrinsics API
   423     private static final Unsafe U = Unsafe.getUnsafe();
   423     private static final Unsafe U = Unsafe.getUnsafe();
   424     private static final long PARKBLOCKER = U.objectFieldOffset
   424     private static final long PARKBLOCKER = U.objectFieldOffset