摘要:
from threading import Thread,Lock from time import sleep class Task1(Thread): """y';]lopppdocstring for Task1""" def run(self): while 1: if lock1.acquire(): print("---task1----") ... 阅读全文
摘要:
线程同步能够保证多个线程安全访问竞争资源,最简单的同步机制是引入互斥锁 执行结果 阅读全文