Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Lib/multiprocessing/queues.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,14 @@ def task_done(self):
if self._unfinished_tasks._semlock._is_zero():
self._cond.notify_all()

def join(self):
def join(self, timeout=None) -> None:
with self._cond:
if not self._unfinished_tasks._semlock._is_zero():
self._cond.wait()
self._cond.wait(timeout=timeout)

def is_done(self) -> bool:
with self._cond:
return self._unfinished_tasks._semlock._is_zero()

#
# Simplified Queue type -- really just a locked pipe
Expand Down
Loading