Skip to main content

scottbrian-locking

Intro

The SELock is a shared/exclusive lock that you can use to coordinate read and write access to a resource in a multithreaded application.

Example:

use SELock to coordinate access to a resource

>>> from scottbrian_locking import se_lock as sel
>>> a_lock = sel.SELock()
>>> # Get lock in exclusive mode
>>> with sel.SELockExcl(a_lock):
...     msg = 'lock obtained exclusive'
>>> print(msg)
lock obtained exclusive
>>> # Get lock in shared mode
>>> with sel.SELockShare(a_lock):
...     msg = 'lock obtained shared'
>>> print(msg)
lock obtained shared
Security Status Documentation Status

Installation

Windows:

pip install scottbrian-locking

Development setup

See tox.ini

Release History

  • 1.0.0
    • Initial release

  • 1.1.0
    • Add RELockObtain context manager

    • support python 3.11

  • 2.0.0
    • Add obtain_tf to context manager

    • Add allow_recursive_obtain

    • Delete setup.cfg

    • Make consistent log and error messages

    • Support python 3.12

    • Drop support for python < 3.12

  • 2.0.1
    • Fix documentation
      • change docs/source/index.rst

      • change docs/requirements.txt

      • change readthedoc.yml

  • 2.0.2
    • Fix verify_lock to refresh lock_info

    • Fix thread name in release granted log message

  • 2.1.0
    • Support python 3.13

  • 2.1.1
    • Support tox parallel

  • 3.0.0
    • Add support for python 3.14

    • Drop support for python < 3.14

Meta

Scott Tuttle

Distributed under the MIT license. See LICENSE for more information.

Contributing

  1. Fork it (<https://github.com/yourname/yourproject/fork>)

  2. Create your feature branch (git checkout -b feature/fooBar)

  3. Commit your changes (git commit -am ‘Add some fooBar’)

  4. Push to the branch (git push origin feature/fooBar)

  5. Create a new Pull Request

Metadata

Release files for scottbrian-locking 3.0.0

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

Source distribution (sdist)

Source distribution for scottbrian-locking 3.0.0
File Size Uploaded
scottbrian_locking-3.0.0.tar.gz 35.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scottbrian-locking 3.0.0
File Interpreter ABI Platform
scottbrian_locking-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 48.8 kB

Release files / scottbrian_locking-3.0.0.tar.gz

Download URL scottbrian_locking-3.0.0.tar.gz
Size 35.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4abb5e58d4d05e927884e871319ea71d483e45fa73e14d2d33de94cf494def0a
BLAKE2b-256 checksum
How to use checksums
fc7590b8046e12787a83e07395ddfc168a418860b176c6202e97fa7334a55fa4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release files / scottbrian_locking-3.0.0-py3-none-any.whl

Download URL scottbrian_locking-3.0.0-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6051c00f59fbe39d0bcbf00dffbf85690c3f454eeaf10e179c0cb5e0afec5a76
BLAKE2b-256 checksum
How to use checksums
0e225dc322929c91419c320db7398c0792a905285dd873496df67eb5873a7aa4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

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