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

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

             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) 評論(0)  編輯 收藏 引用

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


            国产成人精品久久一区二区三区 | 亚洲AV日韩精品久久久久久久| 无码任你躁久久久久久| 国产精品久久久久久久久久影院| 精品久久久无码人妻中文字幕豆芽| 久久精品国产免费| 久久久精品午夜免费不卡| 一级做a爰片久久毛片看看| 国产精品免费久久久久影院| 欧美喷潮久久久XXXXx| 中文字幕久久波多野结衣av| 久久久久综合中文字幕| 久久精品无码一区二区三区免费| 国产精品无码久久久久久| 99久久国产热无码精品免费 | 久久精品水蜜桃av综合天堂| 亚洲中文久久精品无码ww16| 亚洲国产精品无码久久久秋霞2| 亚洲伊人久久成综合人影院 | 99久久免费国产特黄| 久久精品人成免费| 91精品国产色综久久 | 久久w5ww成w人免费| 91麻精品国产91久久久久| 久久午夜无码鲁丝片午夜精品| 欧美日韩精品久久久久| 亚洲AV无码久久精品狠狠爱浪潮 | 久久国产热精品波多野结衣AV| 91精品国产91久久综合| 亚洲欧洲中文日韩久久AV乱码| 精品久久久中文字幕人妻| 日本久久久久久久久久| 狠狠狠色丁香婷婷综合久久五月 | 久久亚洲2019中文字幕| 91久久九九无码成人网站| 久久亚洲精品成人无码网站| 久久露脸国产精品| 热久久国产精品| 久久精品无码av| 亚洲国产日韩欧美综合久久| 久久精品国产第一区二区三区|