The JVM Tool Interface has several call-stack related functions (e.g., GetStackTrace
, GetFrameCount
, or GetLocalInstance
) which take a jthread
as argument to determine the affected thread. All of them take a NULL
argument to mean “the current thread.“
Now suppose I already have a jthread
referring to the current thread. Which one is then faster?
- Explicitly passing the current thread as
jthread
- Passing
NULL