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


            欧美国产成人久久精品| 久久99精品久久久久久野外| 久久涩综合| 久久人人爽人人爽人人片av麻烦| 久久婷婷色综合一区二区| 久久亚洲精精品中文字幕| 国产精品无码久久久久久| 久久精品国产一区二区三区| 蜜桃麻豆WWW久久囤产精品| 精品久久久久香蕉网| 久久精品国产欧美日韩| 亚洲AV日韩精品久久久久久| 亚洲国产精品热久久| 久久精品国产亚洲αv忘忧草 | 久久99热这里只频精品6| 国内精品久久久久伊人av| 久久久久国产一区二区| 狠狠色噜噜狠狠狠狠狠色综合久久 | 久久国产精品一区| 久久久久综合网久久| 精品国产青草久久久久福利| 久久精品免费网站网| 久久精品国产亚洲沈樵| 蜜臀av性久久久久蜜臀aⅴ麻豆| 久久久久国产一区二区三区| 久久综合久久综合久久| 久久精品国产99久久无毒不卡 | 亚洲香蕉网久久综合影视| 免费精品久久久久久中文字幕| 久久久久久久99精品免费观看| 人妻无码αv中文字幕久久| 伊人情人综合成人久久网小说| 久久久久国产日韩精品网站| 精品久久久久久无码免费| 99久久成人18免费网站| 久久er国产精品免费观看8| 久久噜噜电影你懂的| 久久久久成人精品无码中文字幕| 久久精品国产亚洲Aⅴ蜜臀色欲| 久久精品国产亚洲av麻豆色欲 | 99999久久久久久亚洲|