acquire方法
Python Lock.acquire()方法 (Python Lock.acquire() Method)
acquire() is an inbuilt method of the Lock class of the threading module in Python.
acquisition()是Python中线程模块的Lock类的内置方法。
This method is used to acquire a lock, either blocking or non-blocking. When it is invoked without arguments, it blocks the calling thread until the lock is unlocked by the thread using it currently.
此方法用于获取锁定,无论是锁定还是非锁定。 在不带参数的情况下调用它时,它将阻塞调用线程,直到当前使用它的线程将锁解锁。
Module:
模块:
from threading import Lock
Syntax:
句法:
acquire( blocking=True, timeout=-1)