摘要: import threadingimport timeclass Mythread(threading.Thread): def run(self): global num if mutex.acquire(): num+=1 print num mutex.release()num=0mutex=threading.Lock()def test(): for i in range(5): t=Mythread() t.start()if __name__ ==... 阅读全文
posted @ 2014-03-27 11:59 huangxiaohen 阅读(145) 评论(0) 推荐(0) 编辑