• <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>

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

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

              C++博客 :: 首頁 :: 聯(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 張樹坤 閱讀(1239) 評(píng)論(0)  編輯 收藏 引用

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


            波多野结衣AV无码久久一区| 久久精品国产只有精品2020| 国产一区二区精品久久岳| 色综合久久综合网观看| 国产免费福利体检区久久| 囯产精品久久久久久久久蜜桃| 久久婷婷色综合一区二区| 91精品国产乱码久久久久久| 久久最新免费视频| 成人妇女免费播放久久久| 亚洲欧洲久久久精品| 国产69精品久久久久99| 一本一道久久a久久精品综合| 精品乱码久久久久久久| 亚洲精品tv久久久久| 久久99热精品| 国产高潮国产高潮久久久| 久久毛片免费看一区二区三区| 久久久久亚洲av无码专区导航 | 中文字幕一区二区三区久久网站| 久久久无码精品亚洲日韩京东传媒 | AV无码久久久久不卡网站下载| 久久亚洲av无码精品浪潮| 久久精品无码一区二区三区| 99精品久久久久久久婷婷| 国产成人久久精品二区三区| 精品无码久久久久久尤物| 亚洲AV无码成人网站久久精品大| 性高湖久久久久久久久AAAAA| 久久国产热这里只有精品| 国产亚洲成人久久| 精品国际久久久久999波多野 | 亚洲精品无码久久不卡| 青春久久| 久久精品成人欧美大片| 欧美精品乱码99久久蜜桃| 精品久久久久久无码不卡| 伊人色综合久久天天人守人婷 | 国产精品久久影院| 99久久99久久精品免费看蜜桃| 久久婷婷五月综合97色 |