java.lang.Thread.internalGetState()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(162)

本文整理了Java中java.lang.Thread.internalGetState()方法的一些代码示例,展示了Thread.internalGetState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Thread.internalGetState()方法的具体详情如下:
包路径:java.lang.Thread
类名称:Thread
方法名:internalGetState

Thread.internalGetState介绍

暂无

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Returns the current state of the Thread. This method is useful for
 * monitoring purposes.
 *
 * @return a {@link State} value.
 */
public State getState() {
  if (threadPtr != 0) {
    int s = internalGetState(this);
    switch (s) {
    case 0: return State.TERMINATED;    // ZOMBIE
    case 1: return State.RUNNABLE;      // RUNNING
    case 2: return State.TIMED_WAITING; // TIMED_WAIT
    case 3: return State.BLOCKED;       // MONITOR
    case 4: return State.WAITING;       // WAIT
    case 5: return State.NEW;           // INITIALIZING
    case 6: return State.NEW;           // STARTING
    case 7: return State.RUNNABLE;      // NATIVE
    case 8: return State.WAITING;       // VMWAIT
    case 9: return State.RUNNABLE;      // SUSPENDED
    }
  }
  return started ? State.TERMINATED : State.NEW;
}
private static native int internalGetState(Thread thread);

代码示例来源:origin: ibinti/bugvm

/**
 * Returns the current state of the Thread. This method is useful for
 * monitoring purposes.
 *
 * @return a {@link State} value.
 */
public State getState() {
  if (threadPtr != 0) {
    int s = internalGetState(this);
    switch (s) {
    case 0: return State.TERMINATED;    // ZOMBIE
    case 1: return State.RUNNABLE;      // RUNNING
    case 2: return State.TIMED_WAITING; // TIMED_WAIT
    case 3: return State.BLOCKED;       // MONITOR
    case 4: return State.WAITING;       // WAIT
    case 5: return State.NEW;           // INITIALIZING
    case 6: return State.NEW;           // STARTING
    case 7: return State.RUNNABLE;      // NATIVE
    case 8: return State.WAITING;       // VMWAIT
    case 9: return State.RUNNABLE;      // SUSPENDED
    }
  }
  return started ? State.TERMINATED : State.NEW;
}
private static native int internalGetState(Thread thread);

代码示例来源:origin: MobiVM/robovm

/**
 * Returns the current state of the Thread. This method is useful for
 * monitoring purposes.
 *
 * @return a {@link State} value.
 */
public State getState() {
  if (threadPtr != 0) {
    int s = internalGetState(this);
    switch (s) {
    case 0: return State.TERMINATED;    // ZOMBIE
    case 1: return State.RUNNABLE;      // RUNNING
    case 2: return State.TIMED_WAITING; // TIMED_WAIT
    case 3: return State.BLOCKED;       // MONITOR
    case 4: return State.WAITING;       // WAIT
    case 5: return State.NEW;           // INITIALIZING
    case 6: return State.NEW;           // STARTING
    case 7: return State.RUNNABLE;      // NATIVE
    case 8: return State.WAITING;       // VMWAIT
    case 9: return State.RUNNABLE;      // SUSPENDED
    }
  }
  return started ? State.TERMINATED : State.NEW;
}
private static native int internalGetState(Thread thread);

代码示例来源:origin: FlexoVM/flexovm

/**
 * Returns the current state of the Thread. This method is useful for
 * monitoring purposes.
 *
 * @return a {@link State} value.
 */
public State getState() {
  if (threadPtr != 0) {
    int s = internalGetState(this);
    switch (s) {
    case 0: return State.TERMINATED;    // ZOMBIE
    case 1: return State.RUNNABLE;      // RUNNING
    case 2: return State.TIMED_WAITING; // TIMED_WAIT
    case 3: return State.BLOCKED;       // MONITOR
    case 4: return State.WAITING;       // WAIT
    case 5: return State.NEW;           // INITIALIZING
    case 6: return State.NEW;           // STARTING
    case 7: return State.RUNNABLE;      // NATIVE
    case 8: return State.WAITING;       // VMWAIT
    case 9: return State.RUNNABLE;      // SUSPENDED
    }
  }
  return started ? State.TERMINATED : State.NEW;
}
private static native int internalGetState(Thread thread);

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Returns the current state of the Thread. This method is useful for
 * monitoring purposes.
 *
 * @return a {@link State} value.
 */
public State getState() {
  if (threadPtr != 0) {
    int s = internalGetState(this);
    switch (s) {
    case 0: return State.TERMINATED;    // ZOMBIE
    case 1: return State.RUNNABLE;      // RUNNING
    case 2: return State.TIMED_WAITING; // TIMED_WAIT
    case 3: return State.BLOCKED;       // MONITOR
    case 4: return State.WAITING;       // WAIT
    case 5: return State.NEW;           // INITIALIZING
    case 6: return State.NEW;           // STARTING
    case 7: return State.RUNNABLE;      // NATIVE
    case 8: return State.WAITING;       // VMWAIT
    case 9: return State.RUNNABLE;      // SUSPENDED
    }
  }
  return started ? State.TERMINATED : State.NEW;
}
private static native int internalGetState(Thread thread);

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Returns the current state of the Thread. This method is useful for
 * monitoring purposes.
 *
 * @return a {@link State} value.
 */
public State getState() {
  if (threadPtr != 0) {
    int s = internalGetState(this);
    switch (s) {
    case 0: return State.TERMINATED;    // ZOMBIE
    case 1: return State.RUNNABLE;      // RUNNING
    case 2: return State.TIMED_WAITING; // TIMED_WAIT
    case 3: return State.BLOCKED;       // MONITOR
    case 4: return State.WAITING;       // WAIT
    case 5: return State.NEW;           // INITIALIZING
    case 6: return State.NEW;           // STARTING
    case 7: return State.RUNNABLE;      // NATIVE
    case 8: return State.WAITING;       // VMWAIT
    case 9: return State.RUNNABLE;      // SUSPENDED
    }
  }
  return started ? State.TERMINATED : State.NEW;
}
private static native int internalGetState(Thread thread);

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Returns the current state of the Thread. This method is useful for
 * monitoring purposes.
 *
 * @return a {@link State} value.
 */
public State getState() {
  if (threadPtr != 0) {
    int s = internalGetState(this);
    switch (s) {
    case 0: return State.TERMINATED;    // ZOMBIE
    case 1: return State.RUNNABLE;      // RUNNING
    case 2: return State.TIMED_WAITING; // TIMED_WAIT
    case 3: return State.BLOCKED;       // MONITOR
    case 4: return State.WAITING;       // WAIT
    case 5: return State.NEW;           // INITIALIZING
    case 6: return State.NEW;           // STARTING
    case 7: return State.RUNNABLE;      // NATIVE
    case 8: return State.WAITING;       // VMWAIT
    case 9: return State.RUNNABLE;      // SUSPENDED
    }
  }
  return started ? State.TERMINATED : State.NEW;
}
private static native int internalGetState(Thread thread);

相关文章