Python module for an atomic named lock which is local to the machine.
Project description
Python module for an atomic named-lock which is local to the machine.
NamedAtomicLock works by taking advantage of the fact that POSIX defines mkdir to be an atomic operation. So a directory is used as the name.
All UNIX systems are supported, overhead is light, and the lock is global to the system.
The NamedAtomicLock module provides a class NamedAtomicLock which implements the “lock” interface, with familiar “acquire” and “release” methods.
Documentation
Example
A basic usage example
from NamedAtomicLock import NamedAtomicLock
myLock = NamedAtomicLock(‘myLock’)
if myLock.acquire(timeout=15):
doWork()
myLock.release()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file NamedAtomicLock-1.0.0.tar.gz
.
File metadata
- Download URL: NamedAtomicLock-1.0.0.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 756ae2813ee11366dcdbc9641cc70e5bbff75473115dffbf647f052b9251af9a |
|
MD5 | 53f165399c501e44ff5446885e4df4f3 |
|
BLAKE2b-256 | a2151b3e13a3bd0b166813448837f1cdec3001b3a04fc727a377599689b4d36d |