Skip to content

Commit

Permalink
Review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
aebrahim committed Oct 24, 2023
1 parent 7c602ed commit 5b8142d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions once_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ def once_fn(self):

once_obj = _CallOnceClass()

@execute_with_barrier(n_workers=_N_WORKERS)
@execute_with_barrier(n_workers=_N_WORKERS) # increases chance of a race
def execute(_):
return once_obj.once_fn()

Expand Down Expand Up @@ -833,10 +833,10 @@ async def counting_fn(*args) -> int:
del args
return counter.get_incremented()

@execute_with_barrier(n_workers=_N_WORKERS)
@execute_with_barrier(n_workers=_N_WORKERS) # increases chance of a race
def execute():
result = counting_fn()
return asyncio.run(result)
coro = counting_fn()
return asyncio.run(coro)

threads = [threading.Thread(target=execute) for i in range(_N_WORKERS)]
for t in threads:
Expand Down

0 comments on commit 5b8142d

Please sign in to comment.