• <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í)博客

            天下難事必做于易,天下大事必做于細

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

            公告

            http://www.zhangsk.cn

            常用鏈接

            留言簿(1)

            我參與的團隊

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

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

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


            日日狠狠久久偷偷色综合免费| 人妻无码久久精品| 99re久久精品国产首页2020| 一本大道久久a久久精品综合| 久久久久国色AV免费看图片| 亚洲国产视频久久| 999久久久无码国产精品| 亚洲午夜无码久久久久小说| 2021久久国自产拍精品| 人妻精品久久久久中文字幕| 2021久久国自产拍精品| 久久精品国产亚洲AV蜜臀色欲| 国产亚洲美女精品久久久久狼| 亚洲欧美一区二区三区久久| 免费国产99久久久香蕉| 久久人妻少妇嫩草AV无码专区| 色天使久久综合网天天 | 久久亚洲av无码精品浪潮| 欧美一区二区三区久久综| 久久精品国产第一区二区| 国产精品视频久久久| 人妻无码αv中文字幕久久| 久久久久久亚洲精品不卡| 国产精品青草久久久久福利99 | 伊人久久大香线蕉无码麻豆| 国产午夜精品理论片久久影视 | 久久精品无码午夜福利理论片| 久久久久久国产精品美女| 97久久精品无码一区二区| 奇米影视7777久久精品| 日韩AV无码久久一区二区 | 久久精品夜色噜噜亚洲A∨| 国产精品久久久久久久久鸭| 亚洲精品午夜国产VA久久成人| 久久久国产99久久国产一| 久久久久国产| 久久丫忘忧草产品| 久久成人国产精品免费软件| 久久婷婷五月综合色奶水99啪| 国产精品久久久久久久人人看| 久久久久人妻一区二区三区 |