摘要:
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__ ==... 阅读全文