<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      小凡156

      博客園 首頁 新隨筆 聯(lián)系 訂閱 管理
       1     /**
            測試當(dāng)前線程是否已中斷。
      2 * Tests whether the current thread has been interrupted.
            此方法清除線程的中斷狀態(tài)。
            The
      <i>interrupted status</i> of the thread is cleared by this method.
            換言之,如果連續(xù)兩次調(diào)用此方法,則第二次調(diào)用將返回false(除非在第一次調(diào)用清除其中斷狀態(tài)后,第二次調(diào)用檢查它之前,當(dāng)前線程再次中斷)。
            In
      other words, if this method were to be called twice in succession, the 5 * second call would return false (unless the current thread were 6 * interrupted again, after the first call had cleared its interrupted 7 * status and before the second call had examined it). 8 * 由于中斷時線程不活動而忽略的線程中斷將由返回false的方法反映。 9 * <p>A thread interruption ignored because a thread was not alive 10 * at the time of the interrupt will be reflected by this method 11 * returning false. 12 * @如果當(dāng)前線程已中斷,則返回<code>true</code>;否則返回<code>false</code>。 13 * @return <code>true</code> if the current thread has been interrupted; 14 * <code>false</code> otherwise. 15 * @see #isInterrupted() 16 * @revised 6.0 17 */ 18 public static boolean interrupted() { 19 return currentThread().isInterrupted(true); 20 }
       1     /**
            測試此線程是否已中斷。線程的中斷狀態(tài)不受此方法的影響。 2 * Tests whether this thread has been interrupted. The <i>interrupted 3 * status</i> of the thread is unaffected by this method. 4 * 5 * <p>A thread interruption ignored because a thread was not alive 6 * at the time of the interrupt will be reflected by this method 7 * returning false. 8 * 9 * @return <code>true</code> if this thread has been interrupted; 10 * <code>false</code> otherwise. 11 * @see #interrupted() 12 * @revised 6.0 13 */ 14 public boolean isInterrupted() { 15 return isInterrupted(false); 16 }
      1     /** 測試某個線程是否被中斷。中斷狀態(tài)是否基于傳遞的ClearInterrupted值重置。
      2      * Tests if some Thread has been interrupted.  The interrupted state
      3      * is reset or not based on the value of ClearInterrupted that is
      4      * passed.
      5      */
      6     private native boolean isInterrupted(boolean ClearInterrupted);
       1 bool os::is_interrupted(Thread* thread, bool clear_interrupted) {
       2 
       3   assert(Thread::current() == thread || Threads_lock->owned_by_self(),
       4 
       5     "possibility of dangling Thread pointer");
       6 
       7 
       8   OSThread* osthread = thread->osthread();
       9 
      10 
      11   bool interrupted = osthread->interrupted();
      12 
      13   如果線程被設(shè)置中斷狀態(tài),且移除中斷狀態(tài),設(shè)置中斷狀態(tài)為false
      14   if (interrupted && clear_interrupted) {
      15 
      16     osthread->set_interrupted(false);
      17 
      18     // consider thread->_SleepEvent->reset() ... optional optimization
      19 
      20   }
      21 
      22 
      23   return interrupted;
      24 
      25 }

      總結(jié): Thread類中的static boolean interrupted()修改中斷狀態(tài)為false  ,boolean isInterrupted()只判斷中斷狀態(tài),但不修改

      public void interrupt()  將調(diào)用者線程的中斷狀態(tài)設(shè)置為true;

      public boolean isInterrupted()  返回調(diào)用者線程的中斷狀態(tài);

      public static boolean interrupted()  只能通過Thread.interrupted()調(diào)用。

      它會做兩步操作:

      1. 返回currentThread()的中斷狀態(tài);

      2. 將當(dāng)前線程的中斷狀態(tài)修改為false;

       

      posted on 2019-11-02 14:56  小凡156  閱讀(253)  評論(0)    收藏  舉報(bào)
      主站蜘蛛池模板: 性色av免费观看| 四虎永久在线精品8848a| 亚洲欧洲一区二区综合精品| 一区二区三区国产亚洲网站| 国产地址二永久伊甸园| 国产高清在线精品一区不卡| 91福利国产成人精品导航| 久久99热只有频精品8| 国产国产精品人体在线视| 国产WW久久久久久久久久| 55大东北熟女啪啪嗷嗷叫| 天天爽夜夜爱| 亚洲更新最快无码视频| 人人人澡人人肉久久精品| 自拍第一区视频在线观看| 91久久偷偷做嫩草影院免费看| 无码伊人久久大杳蕉中文无码| 亚洲码和欧洲码一二三四| 中文字幕在线观看一区二区| 亚洲丶国产丶欧美一区二区三区| 国产精品SM捆绑调教视频| 久久99国产乱子伦精品免费| 色综合久久精品亚洲国产| 中文字幕av国产精品| 性色av极品无码专区亚洲| 精品一区二区成人码动漫| 老司机精品成人无码AV| 一区二区三区不卡国产| gogogo高清在线播放免费| 最新国产精品拍自在线观看| 曰本丰满熟妇xxxx性| 又黄又刺激又黄又舒服| 欧美乱强伦xxxx孕妇| 国产午夜福利在线视频| 日韩中文字幕人妻一区| 国产男女黄视频在线观看| 国产高清一区二区不卡| 亚洲欧美色综合影院| 国内精品久久久久影视| 久久综合激情网| 特级毛片在线大全免费播放|