diff options
Diffstat (limited to 'lockfile.py')
| -rw-r--r-- | lockfile.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lockfile.py b/lockfile.py index 34279ba..1e0516b 100644 --- a/lockfile.py +++ b/lockfile.py @@ -28,7 +28,14 @@ class LockFileContents: class LockFile(object): """A file locking mechanism that has context-manager support so you - can use it in a with statement. + can use it in a with statement. e.g. + + with LockFile('./foo.lock'): + # do a bunch of stuff... if the process dies we have a signal + # handler to do cleanup. Other code (in this process or another) + # that tries to take the same lockfile will block. There is also + # some logic for detecting stale locks. + """ def __init__( |
