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

Function read

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

Source from the content-addressed store, hash-verified

227 both_inside = asyncio.Event()
228
229 async def read() -> None:
230 nonlocal readers
231 async with lock.read_lock(timeout=10):
232 readers += 1
233 if readers == 2:
234 both_inside.set()
235 await asyncio.wait_for(both_inside.wait(), 10)
236
237 await asyncio.gather(read(), read())
238 await lock.close()

Calls 2

waitMethod · 0.80
read_lockMethod · 0.45

Tested by

no test coverage detected