你这样做是错的. threading.Lock
不是一个对象.
>>> import threading >>> threading.Lock>>> type(threading.Lock) >>> x=threading.Lock() >>> type(x) >>> dir(x) ['__enter__', '__exit__', 'acquire', 'acquire_lock', 'locked', 'locked_lock', 'release', 'release_lock'] >>>