• <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 張樹坤 閱讀(1232) 評(píng)論(0)  編輯 收藏 引用

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


            欧美精品丝袜久久久中文字幕| 久久亚洲AV成人无码电影| 无码国产69精品久久久久网站| 久久婷婷五月综合色奶水99啪 | 久久99毛片免费观看不卡| 久久精品国产亚洲AV高清热 | 久久精品国产亚洲AV不卡| 亚洲AV日韩AV永久无码久久| 国产精品美女久久久久久2018| 久久精品人人做人人爽97| 欧美久久综合性欧美| 久久人人爽人人爽人人片AV不 | 亚洲午夜久久久久妓女影院 | 亚洲精品无码专区久久同性男| 伊人色综合九久久天天蜜桃| 99久久综合国产精品免费| 久久综合久久综合久久综合| 要久久爱在线免费观看| 精品久久777| 人妻精品久久无码专区精东影业| 久久久久99精品成人片| 亚洲国产精品无码久久久蜜芽| 久久精品中文字幕一区| 囯产极品美女高潮无套久久久| 久久久久亚洲精品天堂久久久久久| 久久精品国产日本波多野结衣| 国产日韩久久久精品影院首页| 熟妇人妻久久中文字幕| 亚洲国产视频久久| 久久久青草久久久青草| 久久国产欧美日韩精品| 色欲av伊人久久大香线蕉影院| 国产精品久久久久久久久久影院| 国产精品成人99久久久久91gav| 久久精品国产亚洲AV嫖农村妇女| 国产精品亚洲综合久久| 亚洲国产成人久久精品99 | 国内精品久久久久影院优| 久久综合亚洲色一区二区三区| 久久国产精品偷99| 久久国产福利免费|