首页 > 其他 > 详细

Thread.State

时间:2016-02-23 00:44:25      阅读:346      评论:0      收藏:0      [点我收藏+]

 

public static enum Thread.State
extends Enum<Thread.State>
A thread state. A thread can be in one of the following states:
  • NEW
    A thread that has not yet started is in this state.
  • RUNNABLE
    A thread executing in the Java virtual machine is in this state.
  • BLOCKED
    A thread that is blocked waiting for a monitor lock is in this state.   请求获得锁
  • WAITING
    A thread that is waiting indefinitely for another thread to perform a particular action is in this state.    等待别的线程的响应      
  • TIMED_WAITING
    A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state.
  • TERMINATED
    A thread that has exited is in this state.   线程结束

A thread can be in only one state at a given point in time. These states are virtual machine states which do not reflect any operating system thread states.

可以通过thread.getState()查看线程所处的状态

Thread.State

原文:http://www.cnblogs.com/YDDMAX/p/5208561.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!