Skip to main content

Combo Lock

The combo-lock is a combination of a process lock and a thread lock. Usable in cases both multiple threads and multiple processes are sharing the same resource such as a file in the file system.

The module utilizes the FileLock from filelock and the standard Lock from threading.

The FileLock uses a filesystem lock so the initialization of the class requires a path for the lock file.

Example

from combo_lock import ComboLock

lock = ComboLock('/tmp/my.lock')

with lock:
    write_my_shared_resource()

A NamedLock will save the lock file to shared memory using memory-tempfile

from combo_lock import NamedLock

lock = NamedLock('some_name')

with lock:
    write_my_shared_resource()

History

The combo-lock was originally created for Mycroft-core but as it's been useful in other projects a separate release seemed appropriate.

Metadata

Release files for combo-lock 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for combo-lock 0.3.2
File Size Uploaded Provenance Actions
combo_lock-0.3.2.tar.gz 9.3 kB Without provenance Details for combo_lock-0.3.2.tar.gz

Release files / combo_lock-0.3.2.tar.gz

Download URL combo_lock-0.3.2.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
46d71476bfd1e5729296a0d8ed658fb0ec6f042f524ba8775d7d33b7f7037bf7
BLAKE2b-256 checksum
How to use checksums
0fb719444048ff2d3f92893b4edf10ec3d3ffc2f7e825f365d10bcba3f51c36d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for combo-lock 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page