• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            張樹(shù)坤的學(xué)習(xí)博客

            天下難事必做于易,天下大事必做于細(xì)

              C++博客 :: 首頁(yè) :: 聯(lián)系 :: 聚合  :: 管理
              9 Posts :: 1 Stories :: 4 Comments :: 0 Trackbacks

            公告

            http://www.zhangsk.cn

            常用鏈接

            留言簿(1)

            我參與的團(tuán)隊(duì)

            搜索

            •  

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

             1 #coding=utf-8
             2 
             3 # locks.py zhangsk
             4 import threading, time
             5 
             6 = 50
             7 = threading.Lock()
             8 
             9 def threadcode():
            10     """This is run in the created threads"""
            11     global b
            12     print "Thread %s invoked" % threading.currentThread().getName()
            13     l.acquire()
            14     try:
            15         print "Thread %s running" % threading.currentThread().getName()
            16         time.sleep(1)
            17         b = b + 50
            18         print "Thread %s set b to %d" % (threading.currentThread().getName(), b)
            19     finally:
            20         l.release()
            21         
            22 print "Value of b at start of program:", b
            23 childthreads = []
            24 
            25 for i in range(15):
            26     t = threading.Thread(target = threadcode, name = "Thread-%d" % i)
            27     t.setDaemon(1)
            28     t.start()
            29     childthreads.append(t)
            30     
            31 for t in childthreads:
            32     t.join()
            33     
            34 print "New Value of b:", b

            posted on 2007-10-09 13:34 張樹(shù)坤 閱讀(1239) 評(píng)論(0)  編輯 收藏 引用

            只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問(wèn)   Chat2DB   管理


            99国内精品久久久久久久| 久久国产美女免费观看精品| 久久人人爽人人人人爽AV | 亚洲精品NV久久久久久久久久 | 久久综合亚洲鲁鲁五月天| 久久精品国产99久久久古代| 久久久国产精品网站| 国产精品久久婷婷六月丁香| 久久91综合国产91久久精品| 国产免费久久精品99re丫y| 精品久久久久久成人AV| 久久一本综合| 久久精品国产福利国产秒| 2019久久久高清456| 国产99久久久国产精免费| 久久99亚洲网美利坚合众国| 亚洲欧美国产精品专区久久| 99久久精品免费看国产| 久久天天躁狠狠躁夜夜96流白浆 | 国产精品亚洲美女久久久| 无码久久精品国产亚洲Av影片 | 久久久久国色AV免费观看| MM131亚洲国产美女久久| 久久久久久久综合狠狠综合| 久久99热这里只有精品国产| 精品久久久久久久无码| 久久婷婷五月综合97色| 久久无码高潮喷水| 精品国产日韩久久亚洲| 人妻丰满?V无码久久不卡| 久久黄色视频| 久久久久国产精品麻豆AR影院| 66精品综合久久久久久久| 狠狠狠色丁香婷婷综合久久五月 | 亚洲精品美女久久777777| 欧美激情一区二区久久久| 亚洲国产视频久久| 久久伊人精品一区二区三区| 伊人 久久 精品| 新狼窝色AV性久久久久久| 久久狠狠爱亚洲综合影院 |