diff options
author | zsdc <taras@vyos.io> | 2024-07-03 22:45:52 +0300 |
---|---|---|
committer | zsdc <taras@vyos.io> | 2024-07-03 22:45:52 +0300 |
commit | 0160823d084d141be71299c0e51d9dd3c27ede94 (patch) | |
tree | 96f6c994a2f900ee0ed1c5b9d419a46d6a02dac8 /src/conf_mode | |
parent | 2eb80002145bbd4b4d965b14ba401378b45bfc80 (diff) | |
download | vyos-1x-0160823d084d141be71299c0e51d9dd3c27ede94.tar.gz vyos-1x-0160823d084d141be71299c0e51d9dd3c27ede94.zip |
locking: T6544: Added locking util
Sometimes we need a reliable way to lock an execution until some other operation
is not done.
This commit introduces locking util, which can be used as a common lock, even
between different processes.
Usage example:
```
from vyos.utils.locking import Lock
lock = Lock('my_lock_id')
lock.acquire(timeout=10)
print(f'Lock acquired: {lock.is_locked}')
lock.release()
```
Diffstat (limited to 'src/conf_mode')
0 files changed, 0 insertions, 0 deletions