How to use the locket.__init__._Locker function in locket

To help you get started, we’ve selected a few locket examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mwilliamson / locket.py / locket / __init__.py View on Github external
def lock_file(path, **kwargs):
    _locks_lock.acquire()
    try:
        lock = _locks.get(path)
        if lock is None:
            lock = _create_lock_file(path)
            _locks[path] = lock
    finally:
        _locks_lock.release()
    return _Locker(lock, **kwargs)

locket

File-based locks for Python on Linux and Windows

BSD-2-Clause
Latest version published 3 years ago

Package Health Score

68 / 100
Full package analysis

Similar packages