mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Fix multiprocessing.event to match the new threading.Event API
This commit is contained in:
parent
a83da3507f
commit
02cb0eb231
3 changed files with 20 additions and 7 deletions
|
@ -301,5 +301,10 @@ class Event(object):
|
|||
self._flag.release()
|
||||
else:
|
||||
self._cond.wait(timeout)
|
||||
|
||||
if self._flag.acquire(False):
|
||||
self._flag.release()
|
||||
return True
|
||||
return False
|
||||
finally:
|
||||
self._cond.release()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue