equal
deleted
inserted
replaced
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 |