Sometimes when native code is reached in an agent, the jthread isn't
available, e.g. BCI injection that calls into the agent.
I can't get the current Thread from JVMTI.
I solved this in the BCI java code by calling Thread.currentThread()
in the java level, but it would be handy to have done this in the native code.
Not a high priority.
-kto
-------------------------------------------------------------------
While investigating a fix for the debugger backend (5098199) I discovered
that handling interrupts is tricky without having this interface.
The debugger backend uses the JNIEnv* to look up in it's internal table to
find the the ThreadNode* structure when it gets an INTERRUPT error
return. A series of JNIEnv* comparisons on every JNIEnv* ever seen
looking for the match, which finds the jthread. Kinda slow.
Granted the logic could be re-worked to use NULL for the current thread
request and ThreadLocalStorage, but but jthread==NULL also implies errors
in places, and sometimes a list of jthreads need to be searched and
you can't do that without the actual jthread.
So it makes it awkward.
So one more vote for this interface, but again not urgent.
###@###.### 2004-09-27
available, e.g. BCI injection that calls into the agent.
I can't get the current Thread from JVMTI.
I solved this in the BCI java code by calling Thread.currentThread()
in the java level, but it would be handy to have done this in the native code.
Not a high priority.
-kto
-------------------------------------------------------------------
While investigating a fix for the debugger backend (5098199) I discovered
that handling interrupts is tricky without having this interface.
The debugger backend uses the JNIEnv* to look up in it's internal table to
find the the ThreadNode* structure when it gets an INTERRUPT error
return. A series of JNIEnv* comparisons on every JNIEnv* ever seen
looking for the match, which finds the jthread. Kinda slow.
Granted the logic could be re-worked to use NULL for the current thread
request and ThreadLocalStorage, but but jthread==NULL also implies errors
in places, and sometimes a list of jthreads need to be searched and
you can't do that without the actual jthread.
So it makes it awkward.
So one more vote for this interface, but again not urgent.
###@###.### 2004-09-27