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

Function write

tests/soft/read_write/test_async.py:204–211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

202 inside = peak = 0
203
204 async def write() -> None:
205 nonlocal inside, peak
206 async with lock.write_lock():
207 inside += 1
208 peak = max(peak, inside)
209 await asyncio.sleep(0)
210 inside -= 1
211 progress.put_nowait(None)
212
213 writers = [asyncio.create_task(write()) for _ in range(10)]
214 # A shared deadline can expire during ten slow disk flushes on Windows.

Calls 2

sleepMethod · 0.80
write_lockMethod · 0.45

Tested by

no test coverage detected