Minor change to semaphore test
This commit is contained in:
parent
d8b2066126
commit
654add480d
|
@ -2,7 +2,6 @@ import structio
|
|||
|
||||
|
||||
async def child(i: int, sem: structio.Semaphore):
|
||||
print(f"[child {i}] I'm alive!")
|
||||
async with sem:
|
||||
print(f"[child {i}] Entered critical section")
|
||||
await structio.sleep(1)
|
||||
|
@ -28,4 +27,4 @@ async def main(n: int, k):
|
|||
|
||||
|
||||
# Should exit in about k seconds
|
||||
structio.run(main, 3, 2)
|
||||
structio.run(main, 3, 5)
|
||||
|
|
Loading…
Reference in New Issue