<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    java多線程中sleep()和join()的區別

    If the Sleep method is called with System.Threading.Timeout.Infinite passed in as the parameter, the thread will remain in the WaitSleepJoin state until a different thread wakes it by using the Interrupt method. Thread.Sleep(System.Threading.Timeout.Infinite)

    One reason you might want to do this is if a thread determines that it is in a state where the best thing it can do is nothing. This may be an alternative to ending the thread by using the Abort method, or simply exiting the thread’s method. Once a thread ends, there is no way to restart it. However, if a thread calls the Sleep method and passes in Infinite for the timeout value, it is possible to exit that state at a later time. This concept is similar to calling Join.

    When Join is called and no parameter is passed in, the current thread will wait indefinitely for the thread to end. When Join is called with a timeout value, the Join method will block for at most that period of time and then return a value indicating if the thread of interest ended. A key difference is that Join is called on a different thread while Sleep is called on the current thread. Join also causes the current thread to pause for a period of time, but with the idea that it is waiting for some other thread to terminate. At the point the thread being joined terminates, the Join method returns.

    posted on 2007-12-12 15:21 劉錚 閱讀(825) 評論(0)  編輯  收藏 所屬分類: JAVA General

    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    導航

    統計

    留言簿(1)

    文章分類(141)

    文章檔案(147)

    搜索

    最新評論

    主站蜘蛛池模板: 免费萌白酱国产一区二区三区| 一级中文字幕免费乱码专区 | 成年女人色毛片免费看| 精品亚洲永久免费精品| 国产一区二区三区免费观看在线| 亚洲一区二区三区偷拍女厕| 最新亚洲成av人免费看| 亚洲AV无码精品色午夜果冻不卡 | 国产午夜精品久久久久免费视| 国产亚洲精品岁国产微拍精品| 国产午夜免费高清久久影院| 亚洲图片在线观看| 国产日本一线在线观看免费| 伊人久久五月丁香综合中文亚洲| 精品国产精品久久一区免费式| 黄色一级免费网站| 亚洲色婷婷一区二区三区| 性xxxxx大片免费视频| 亚洲人成在线免费观看| 日本无吗免费一二区| 一级做a爰片久久毛片免费陪 | 久久亚洲精品成人AV| 青娱乐免费在线视频| 亚洲爆乳少妇无码激情| 亚洲婷婷国产精品电影人久久| 黄色网站软件app在线观看免费| 亚洲精品美女久久久久| 最近的中文字幕大全免费版| 又黄又大的激情视频在线观看免费视频社区在线 | 日本人成在线视频免费播放| 亚洲乱码无限2021芒果| 五月婷婷亚洲综合| 免费一级毛片无毒不卡| 亚洲美国产亚洲AV| 亚洲中文字幕无码一区 | 亚洲 小说区 图片区 都市| 国产一区二区免费视频| 一本色道久久88亚洲精品综合| 亚洲中文无韩国r级电影| 99久久综合精品免费| 美女免费精品高清毛片在线视|