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

Method close

src/filelock/_read_write.py:428–440  ·  view source on GitHub ↗

Release the lock (if held) and close the underlying SQLite connection. After calling this method, the lock instance is no longer usable.

(self)

Source from the content-addressed store, hash-verified

426 self._release(force=force, close=False)
427
428 def close(self) -> None:
429 """
430 Release the lock (if held) and close the underlying SQLite connection.
431
432 After calling this method, the lock instance is no longer usable.
433
434 """
435 with _fork_transition():
436 _ensure_current_process()
437 if self._inherited: # pragma: needs fork
438 return
439 self._raise_if_acquiring("close")
440 self._release(force=True, close=True)
441
442 def _release(self, *, force: bool, close: bool) -> None:
443 with self._transaction_lock, self._internal_lock:

Calls 4

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