PyDocs

Nav

Concurrent Execution

LockType.acquire

_thread

method of LockType
  • LockType.acquire(blocking=True, timeout=-1)
Lock the lock.

Without argument, this blocks if the lock is already locked
(even by the same thread), waiting for another thread to release
the lock, and return True once the lock is acquired.
With an argument, this will only block if the argument is true,
and the return value reflects whether the lock is acquired.
The blocking operation is interruptible.
Changed in 3.2, 3.14
  • 3.2: The timeout parameter is new.
  • 3.2: Lock acquires can now be interrupted by signals on POSIX.
  • 3.14: Lock acquires can now be interrupted by signals on Windows.
0 Examples
No examples for _thread/LockType.acquire.
See Also
No see-alsos for _thread/LockType.acquire
0 Notes
No notes for LockType.acquire