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

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

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

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

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


            久久久久国产精品人妻| 久久婷婷色综合一区二区| 伊人久久大香线蕉综合影院首页| 伊人伊成久久人综合网777| 精品久久久无码人妻中文字幕| 2020久久精品亚洲热综合一本| 无码人妻少妇久久中文字幕蜜桃| 伊人久久综合精品无码AV专区| 国产精品久久久久9999| 欧美久久天天综合香蕉伊| 亚洲香蕉网久久综合影视| 99久久国产综合精品五月天喷水| 欧美日韩精品久久免费| 久久精品国产亚洲一区二区| 亚洲国产天堂久久综合| 久久99中文字幕久久| 久久久久久精品无码人妻| 97久久久久人妻精品专区| 欧美伊人久久大香线蕉综合 | 99久久国产亚洲高清观看2024 | 精品国际久久久久999波多野 | 久久久亚洲欧洲日产国码aⅴ| 大香网伊人久久综合网2020| 99久久精品国产一区二区| 精品久久久久久国产免费了| 91久久婷婷国产综合精品青草| 亚洲国产成人精品无码久久久久久综合| 久久久久久久97| 久久精品人人做人人爽电影| 欧洲性大片xxxxx久久久| 91久久精品视频| 亚洲国产成人久久精品影视| 国产精品女同久久久久电影院 | 久久久国产亚洲精品| 久久久久一级精品亚洲国产成人综合AV区 | 久久人人爽人人爽人人片av麻烦| 国产精品美女久久久久av爽| 久久精品www| 国产精品欧美久久久久无广告| 久久99久久99小草精品免视看| 久久精品国产亚洲欧美|