This interface abstracts raw access to operating system-level threads. In a debugging environment these methods map to, for example, thread_db calls on Solaris (see /usr/include/thread_db.h) or the Win32 debugging API calls. In a runtime environment these might map directly to pthread calls.
Implementors of this interface must provide equals() and
hashCode() methods which work properly regardless of how the
ThreadProxy is obtained, in particular either through sun.
or the thread list provided
by sun.
. This allows
matching up of the OS's notion of the thread list of the target
process with any user-level lists that may be present (i.e., the
JavaThread list in the HotSpot VM).
Implementors of this interface should also provide a toString() which converts the ThreadProxy to a value easily recognizable in the platform's debugger. (For example, on Solaris, "t@<id>".)
FIXME: had to be renamed from "Thread" to avoid numerous clashes with java.lang.Thread -- would be nice to pick a more consistent name with the rest of the system.
Modifier and Type | Method and Description |
---|---|
public boolean | |
public ThreadContext | |
public void |
canSetContext | back to summary |
---|---|
public boolean canSetContext() throws DebuggerException Indicates whether calls to setContext() are valid. |
getContext | back to summary |
---|---|
public ThreadContext getContext() throws IllegalThreadStateException Retrieves the context for the given thread. It is only valid to call this method if the thread is suspended (i.e., the process has not been resumed via ProcessControl); throws an IllegalThreadStateException if it is not. |
setContext | back to summary |
---|---|
public void setContext(ThreadContext context) throws IllegalThreadStateException, DebuggerException Sets the context for the given thread. The passed ThreadContext must be a modified version of one returned from a previous call to getContext(). It is only valid to call this method if the thread is suspended (i.e., the process has not been resumed via ProcessControl); throws an IllegalThreadStateException if it is not. Throws a DebuggerException if the target process can not be modified, for example because it is a core file. |