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

Function _hammer

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

Source from the content-addressed store, hash-verified

164
165
166def _hammer(backend: str, path: str) -> None:
167 lock = FileLock(path) if backend == "FileLock" else StrictSoftFileLock(path)
168 for _ in range(_CONTENTION_ACQUISITIONS):
169 lock.acquire()
170 lock.release()
171
172
173def _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