标签:star color ase xrange release imp UI get odi
# coding:utf-8 import threading import time def test_xc(): f = open("test.txt","a") f.write("test_dxc"+‘\n‘) time.sleep(1) mutex.acquire()#取得锁 f.close() mutex.release()#释放锁 if __name__ == ‘__main__‘: mutex = threading.Lock()#创建锁 for i in xrange(5): t = threading.Thread(target=test_xc) t.start()
标签:star color ase xrange release imp UI get odi
原文地址:http://www.cnblogs.com/413xiaol/p/6938258.html