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

Method _release

src/filelock/_native/_windows.py:79–87  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

77
78 @override
79 def _release(self) -> None:
80 fd = cast("int", self._context.lock_file_fd)
81 # An unlock failure leaves the byte range held. Only report release after the kernel commits it.
82 unlock_fd(fd)
83 self._mark_descriptor_released()
84 self._close_released_fd(fd, default_suppresses=False)
85 if not self._settings.preserve_lock_file:
86 with suppress(OSError):
87 unlink_without_oplock_wait(self._lock_path)
88
89 def lock_fd_nonblocking(fd: int) -> bool:
90 # Locking byte zero explicitly keeps reads and writes from changing the locked range.

Callers

nothing calls this directly

Calls 4

_close_released_fdMethod · 0.80
unlock_fdFunction · 0.70

Tested by

no test coverage detected