def release(self):
'''
Release a previously acquired lock.
'''
assert self._locked
assert self._lock_file
# Note that this actually leaves the lock file around, but deleting it without a race
# is not trivial.
fcntl.flock(self._lock_file, fcntl.LOCK_UN)
verbose('Lock "%s" released.' % self._lock_file_path)
self._locked = False
self._lock_file.close()
self._lock_file = None
评论列表
文章目录