本文整理汇总了Java中sun.management.ManagementFactoryHelper.isThreadSuspended方法的典型用法代码示例。如果您正苦于以下问题:Java ManagementFactoryHelper.isThreadSuspended方法的具体用法?Java ManagementFactoryHelper.isThreadSuspended怎么用?Java ManagementFactoryHelper.isThreadSuspended使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.management.ManagementFactoryHelper
的用法示例。
在下文中一共展示了ManagementFactoryHelper.isThreadSuspended方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import sun.management.ManagementFactoryHelper; //导入方法依赖的package包/类
/**
* Initialize ThreadInfo object
*
* @param t Thread
* @param state Thread state
* @param lockObj Object on which the thread is blocked
* @param lockOwner the thread holding the lock
* @param blockedCount Number of times blocked to enter a lock
* @param blockedTime Approx time blocked to enter a lock
* @param waitedCount Number of times waited on a lock
* @param waitedTime Approx time waited on a lock
* @param stackTrace Thread stack trace
* @param lockedMonitors List of locked monitors
* @param lockedSynchronizers List of locked synchronizers
*/
private void initialize(Thread t, int state, Object lockObj, Thread lockOwner,
long blockedCount, long blockedTime,
long waitedCount, long waitedTime,
StackTraceElement[] stackTrace,
MonitorInfo[] lockedMonitors,
LockInfo[] lockedSynchronizers) {
this.threadId = t.getId();
this.threadName = t.getName();
this.threadState = ManagementFactoryHelper.toThreadState(state);
this.suspended = ManagementFactoryHelper.isThreadSuspended(state);
this.inNative = ManagementFactoryHelper.isThreadRunningNative(state);
this.blockedCount = blockedCount;
this.blockedTime = blockedTime;
this.waitedCount = waitedCount;
this.waitedTime = waitedTime;
if (lockObj == null) {
this.lock = null;
this.lockName = null;
} else {
this.lock = new LockInfo(lockObj);
this.lockName =
lock.getClassName() + '@' +
Integer.toHexString(lock.getIdentityHashCode());
}
if (lockOwner == null) {
this.lockOwnerId = -1;
this.lockOwnerName = null;
} else {
this.lockOwnerId = lockOwner.getId();
this.lockOwnerName = lockOwner.getName();
}
if (stackTrace == null) {
this.stackTrace = NO_STACK_TRACE;
} else {
this.stackTrace = stackTrace;
}
this.lockedMonitors = lockedMonitors;
this.lockedSynchronizers = lockedSynchronizers;
}
示例2: initialize
import sun.management.ManagementFactoryHelper; //导入方法依赖的package包/类
/**
* Initialize ThreadInfo object
*
* @param t Thread
* @param state Thread state
* @param lockObj Object on which the thread is blocked
* @param lockOwner the thread holding the lock
* @param blockedCount Number of times blocked to enter a lock
* @param blockedTime Approx time blocked to enter a lock
* @param waitedCount Number of times waited on a lock
* @param waitedTime Approx time waited on a lock
* @param stackTrace Thread stack trace
* @param lockedMonitors List of locked monitors
* @param lockedSynchronizers List of locked synchronizers
*/
private void initialize(Thread t, int state, Object lockObj, Thread lockOwner,
long blockedCount, long blockedTime,
long waitedCount, long waitedTime,
StackTraceElement[] stackTrace,
MonitorInfo[] lockedMonitors,
LockInfo[] lockedSynchronizers) {
this.threadId = t.getId();
this.threadName = t.getName();
this.threadState = ManagementFactoryHelper.toThreadState(state);
this.suspended = ManagementFactoryHelper.isThreadSuspended(state);
this.inNative = ManagementFactoryHelper.isThreadRunningNative(state);
this.blockedCount = blockedCount;
this.blockedTime = blockedTime;
this.waitedCount = waitedCount;
this.waitedTime = waitedTime;
this.daemon = t.isDaemon();
this.priority = t.getPriority();
if (lockObj == null) {
this.lock = null;
this.lockName = null;
} else {
this.lock = new LockInfo(lockObj);
this.lockName =
lock.getClassName() + '@' +
Integer.toHexString(lock.getIdentityHashCode());
}
if (lockOwner == null) {
this.lockOwnerId = -1;
this.lockOwnerName = null;
} else {
this.lockOwnerId = lockOwner.getId();
this.lockOwnerName = lockOwner.getName();
}
if (stackTrace == null) {
this.stackTrace = NO_STACK_TRACE;
} else {
this.stackTrace = stackTrace;
}
this.lockedMonitors = lockedMonitors;
this.lockedSynchronizers = lockedSynchronizers;
}