MCPcopy
hub / github.com/cft0808/edict / _unlock

Function _unlock

scripts/file_lock.py:48–56  ·  view source on GitHub ↗

释放锁。

(fd: int)

Source from the content-addressed store, hash-verified

46
47
48def _unlock(fd: int) -> None:
49 """释放锁。"""
50 if _IS_WINDOWS:
51 try:
52 msvcrt.locking(fd, msvcrt.LK_UNLCK, 1)
53 except OSError:
54 pass
55 else:
56 fcntl.flock(fd, fcntl.LOCK_UN)
57
58
59def _lock_path(path: pathlib.Path) -> pathlib.Path:

Callers 3

atomic_json_readFunction · 0.85
atomic_json_updateFunction · 0.85
atomic_json_writeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected