Getting started
Installation
openlock is available via pip:
$ pip install openlock
Tutorial
For this tutorial we consider a simple situation where multiple processes with the same working directory are trying to access a shared resource.
Create the lock.
l = FileLock()
Acquire the lock.
l.acquire()
Release the lock.
l.release()
Alternatively we may use the context manager protocol.
with FileLock():
...
That’s it!