dcsimg
How can i check if the state of a java Thread using JVMDI?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Davanum_Srinivas
Posted On:   Saturday, July 28, 2001 06:00 AM

How can i check if the state of a java Thread using JVMDI?

Re: How can i check if the state of a java Thread using JVMDI?

Posted By:   shilpa_ratwani  
Posted On:   Monday, July 30, 2001 09:23 AM

The public final boolean isAlive() method returns true if the
thread has been started but the run() method has not yet exited.

The public boolean isInterrupted() method returns true if the
thread is in a waiting state.


With JVMDI :

Get Thread Status
jvmdiError
GetThreadStatus(jthread thread, jint *threadStatusPtr, jint *suspendStatusPtr)

Get status information for a thread.

Parameters:

thread
the thread to query
threadStatusPtr
on return, points to the current status of the thread. The thread status is one of the following values.
JVMDI_THREAD_STATUS_UNKNOWN
Status unknown.

JVMDI_THREAD_STATUS_ZOMBIE
Thread has completed execution.

JVMDI_THREAD_STATUS_RUNNING
Thread is runnable.

JVMDI_THREAD_STATUS_SLEEPING
Thread sleeping. (Thread.sleep() has been called.)

JVMDI_THREAD_STATUS_MONITOR
Thread is waiting to enter a synchronization block.

JVMDI_THREAD_STATUS_WAIT
Thread waiting. (Object.wait() has been called.)
suspendStatusPtr
on return, points to information on suspension. The suspend status is a combination of one or more of the following bit flags.

JVMDI_SUSPEND_STATUS_SUSPENDED
Thread suspended. (java.lang.Thread.suspend() or or SuspendThread has been called.) If this bit is set, the status returned via statusPtr refers to the thread status before suspension.

JVMDI_SUSPEND_STATUS_BREAK
Thread has hit a breakpoint. This bit is only set if the thread is the current thread or the thread is suspended.
This function returns either a universal error or one of the following errors:

JVMDI_ERROR_INVALID_THREAD
thread was invalid.

JVMDI_ERROR_NULL_POINTER
Invalid pointer.
About | Sitemap | Contact