Skip to content

Commit bcbd7d3

Browse files
committed
Fix for missing checks on resources still being available during teardown.
1 parent 315ec3d commit bcbd7d3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Lib/multiprocessing/pool.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,6 @@ def __del__(self, _warn=warnings.warn, RUN=RUN):
268268
if self._state == RUN:
269269
_warn(f"unclosed running multiprocessing pool {self!r}",
270270
ResourceWarning, source=self)
271-
if getattr(self, '_change_notifier', None) is not None:
272-
self._change_notifier.put(None)
273271

274272
def __repr__(self):
275273
cls = self.__class__
@@ -693,7 +691,8 @@ def join(self):
693691
def _help_stuff_finish(inqueue, task_handler, size):
694692
# task_handler may be blocked trying to put items on inqueue
695693
util.debug('removing tasks from inqueue until task handler finished')
696-
inqueue._rlock.acquire()
694+
if inqueue._reader.poll():
695+
inqueue._rlock.acquire()
697696
while task_handler.is_alive() and inqueue._reader.poll():
698697
inqueue._reader.recv()
699698
time.sleep(0)

0 commit comments

Comments
 (0)