Thread.currentThread is a compiler intrinsic, and is not actually a native
call. If you look at the JVM source, you can see it's identified in
vmSymbols.hpp, and linked (eventually) to this implementation:
Every native operating system has some form of thread identifier which can be
acquired by calling e.g. pthread_self(). The thread data structure stored in
the thread’s local area has more information (e.g. the limits of the current
tlab) and the associated Java thread object. For efficiency in