MCPcopy Create free account
hub / github.com/tox-dev/filelock / release

Method release

src/filelock/_read_write.py:410–426  ·  view source on GitHub ↗

Release one level of the current lock. When the lock level reaches zero the underlying SQLite transaction is rolled back, releasing the database lock. :param force: if ``True``, release the lock completely regardless of the current lock level :raises RuntimeError:

(self, *, force: bool = False)

Source from the content-addressed store, hash-verified

408 self.release()
409
410 def release(self, *, force: bool = False) -> None:
411 """
412 Release one level of the current lock.
413
414 When the lock level reaches zero the underlying SQLite transaction is rolled back, releasing the database lock.
415
416 :param force: if ``True``, release the lock completely regardless of the current lock level
417
418 :raises RuntimeError: if no lock is currently held and *force* is ``False``
419
420 """
421 with _fork_transition():
422 _ensure_current_process()
423 if self._inherited: # pragma: needs fork
424 return
425 self._raise_if_acquiring("release")
426 self._release(force=force, close=False)
427
428 def close(self) -> None:
429 """

Calls 4

_raise_if_acquiringMethod · 0.95
_releaseMethod · 0.95
_fork_transitionFunction · 0.85
_ensure_current_processFunction · 0.85