Lock
Usage
Lock(
cache,
key,
expire=None,
tag=None,
)or with lock:. Not reentrant (see RLock); any holder of the key can release it.
acquire() polls every millisecond until it gets the lock. Give it an expire so a holder that dies without releasing doesn’t keep it forever.
Methods
| Name | Description |
|---|---|
| acquire() | Wait for the lock and take it. |
| locked() | Whether someone holds the lock. |
| release() | Release the lock. |
acquire()
Wait for the lock and take it.
Usage
acquire()locked()
Whether someone holds the lock.
Usage
locked()release()
Release the lock.
Usage
release()