美文网首页
线程Thread

线程Thread

作者: Lucky胡 | 来源:发表于2020-06-11 18:09 被阅读0次

参考文献
Android Handler机制1之Thread

public enum State {
        /**
         * Thread state for a thread which has not yet started.
         */
        NEW,

        /**
         * Thread state for a runnable thread.  A thread in the runnable
         * state is executing in the Java virtual machine but it may
         * be waiting for other resources from the operating system
         * such as processor.
         */
        RUNNABLE,

        /**
         * Thread state for a thread blocked waiting for a monitor lock.
         * A thread in the blocked state is waiting for a monitor lock
         * to enter a synchronized block/method or
         * reenter a synchronized block/method after calling
         * {@link Object#wait() Object.wait}.
         */
        BLOCKED,

        /**
         * Thread state for a waiting thread.
         * A thread is in the waiting state due to calling one of the
         * following methods:
         * <ul>
         *   <li>{@link Object#wait() Object.wait} with no timeout</li>
         *   <li>{@link #join() Thread.join} with no timeout</li>
         *   <li>{@link LockSupport#park() LockSupport.park}</li>
         * </ul>
         *
         * <p>A thread in the waiting state is waiting for another thread to
         * perform a particular action.
         *
         * For example, a thread that has called <tt>Object.wait()</tt>
         * on an object is waiting for another thread to call
         * <tt>Object.notify()</tt> or <tt>Object.notifyAll()</tt> on
         * that object. A thread that has called <tt>Thread.join()</tt>
         * is waiting for a specified thread to terminate.
         */
        WAITING,

        /**
         * Thread state for a waiting thread with a specified waiting time.
         * A thread is in the timed waiting state due to calling one of
         * the following methods with a specified positive waiting time:
         * <ul>
         *   <li>{@link #sleep Thread.sleep}</li>
         *   <li>{@link Object#wait(long) Object.wait} with timeout</li>
         *   <li>{@link #join(long) Thread.join} with timeout</li>
         *   <li>{@link LockSupport#parkNanos LockSupport.parkNanos}</li>
         *   <li>{@link LockSupport#parkUntil LockSupport.parkUntil}</li>
         * </ul>
         */
        TIMED_WAITING,

        /**
         * Thread state for a terminated thread.
         * The thread has completed execution.
         */
        TERMINATED;
    }

相关文章

  • 线程协程WWW

    线程:Thread // 新线程-1 调用静态方法 Thread m_Thread_1 = new Thread(...

  • Thread

    线程机制理解开启线程: Thread thread = new Thread(Runnable).start();...

  • 守护线程(Daemon)

    线程分类 User Thread(用户线程) Daemon Thread(守护线程) 定义: 守护线程--也称“服...

  • 多线程

    Java多线程----Thread java使用Thread类代表线程,所有的线程对象必须是Thread类或者其子...

  • 守护线程

    在Java中有两类线程:用户线程 (User Thread)、守护线程 (Daemon Thread)。 守护线程...

  • 守护线程(Daemon Thread)

    守护线程(Daemon Thread) 在Java中有两类线程:用户线程 (User Thread)、守护线程 (...

  • Java并发编程(4):守护线程与线程阻塞的四种情况

    守护线程 Java中有两类线程:User Thread(用户线程)、Daemon Thread(守护线程) 用户线...

  • java线程分类

    守护线程 java中有两类线程,用户线程(User Thread)和守护线程(Daemon Thread)。 守护...

  • 异步和线程池

    四种方式创建线程 1.通过Thread类创建线程 Thread01 thread = new Thread01()...

  • Android Thread 浅析和使用小结

    一.线程的状态 线程包括几个状态 创建(new) Thread thread=new Thread; 就绪(run...

网友评论

      本文标题:线程Thread

      本文链接:https://www.haomeiwen.com/subject/dstitktx.html