Skip to content

Commit b1f599b

Browse files
committed
Changes from review
1 parent 2a30e4f commit b1f599b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/concurrent/futures/process.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ def wakeup(self):
8989
self._writer.send_bytes(b"")
9090

9191
def clear(self):
92-
assert not self._closed
92+
if self._closed:
93+
raise RuntimeError('operation on closed _ThreadWakeup')
9394
while self._reader.poll():
9495
self._reader.recv_bytes()
9596

@@ -714,10 +715,9 @@ def __init__(self, max_workers=None, mp_context=None,
714715
# as it could result in a deadlock if a worker process dies with the
715716
# _result_queue write lock still acquired.
716717
#
717-
# _shutdown_lock must be locked to access _ThreadWakeup.close() and
718-
# .wakeup(). Care must also be taken to not call clear or close from
719-
# more than one thread since _ThreadWakeup.clear() is not protected by
720-
# the _shutdown_lock
718+
# Care must be taken to only call clear and close from the
719+
# executor_manager_thread, since _ThreadWakeup.clear() is not protected
720+
# by a lock.
721721
self._executor_manager_thread_wakeup = _ThreadWakeup()
722722

723723
# Create communication channels for the executor

0 commit comments

Comments
 (0)