当前位置: 首页>>代码示例>>Java>>正文


Java ManagementFactoryHelper.isThreadSuspended方法代码示例

本文整理汇总了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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:56,代码来源:ThreadInfo.java

示例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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:58,代码来源:ThreadInfo.java


注:本文中的sun.management.ManagementFactoryHelper.isThreadSuspended方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。