linkcheck.lock
Locking utility class.
Functions
|
Get a new lock. |
|
Get a new semaphore. |
Classes
|
Debugging lock class. |
- class linkcheck.lock.DebugLock(lock, name)[source]
Bases:
object
Debugging lock class.
Store lock and name parameters.
- linkcheck.lock.get_lock(name, debug=False)[source]
Get a new lock.
- Parameters:
debug (boolean, default is False) – if True, acquire() and release() will have debug messages
- Returns:
a lock object
- Return type:
threading.Lock or DebugLock
- linkcheck.lock.get_semaphore(name, value=None, debug=False)[source]
Get a new semaphore.
- Parameters:
value – if not None, a BoundedSemaphore will be used
debug (boolean, default is False) – if True, acquire() and release() will have debug messages
- Returns:
a semaphore object
- Return type:
threading.Semaphore or threading.BoundedSemaphore or DebugLock