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

Function _hammer

tasks/benchmark.py:179–183  ·  view source on GitHub ↗
(backend: str, path: str)

Source from the content-addressed store, hash-verified

177
178
179def _hammer(backend: str, path: str) -> None:
180 lock = FileLock(path) if backend == "FileLock" else StrictSoftFileLock(path)
181 for _ in range(_CONTENTION_ACQUISITIONS):
182 lock.acquire()
183 lock.release()
184
185
186def _timed(name: str, run: Callable[[], object], *, unit: str, scale: float) -> Sample:

Callers

nothing calls this directly

Calls 3

StrictSoftFileLockClass · 0.90
acquireMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected