Skip to content

Commit

Permalink
Add docstring to specific lock kinds
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Harlow committed Jun 19, 2015
1 parent 83152bc commit 7e1baba
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fasteners/process_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def unlock(self):


class _WindowsLock(_InterProcessLock):
"""Interprocess lock implementation that works on windows systems."""

def trylock(self):
msvcrt.locking(self.lockfile.fileno(), msvcrt.LK_NBLCK, 1)
Expand All @@ -216,6 +217,7 @@ def unlock(self):


class _FcntlLock(_InterProcessLock):
"""Interprocess lock implementation that works on posix systems."""

def trylock(self):
fcntl.lockf(self.lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB)
Expand All @@ -226,13 +228,9 @@ def unlock(self):

if os.name == 'nt':
import msvcrt

#: Interprocess lock implementation that works on your system.
InterProcessLock = _WindowsLock
else:
import fcntl

#: Interprocess lock implementation that works on your system.
InterProcessLock = _FcntlLock


Expand Down

0 comments on commit 7e1baba

Please sign in to comment.