MCPcopy Index your code
hub / github.com/python/cpython / shutdown_workers

Method shutdown_workers

Lib/concurrent/futures/process.py:549–561  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

547 executor._cancel_pending_futures = False
548
549 def shutdown_workers(self):
550 n_children_to_stop = self.get_n_children_alive()
551 n_sentinels_sent = 0
552 # Send the right number of sentinels, to make sure all children are
553 # properly terminated.
554 while (n_sentinels_sent < n_children_to_stop
555 and self.get_n_children_alive() > 0):
556 for i in range(n_children_to_stop - n_sentinels_sent):
557 try:
558 self.call_queue.put_nowait(None)
559 n_sentinels_sent += 1
560 except queue.Full:
561 break
562
563 def join_executor_internals(self):
564 with self.shutdown_lock:

Callers 1

Calls 2

get_n_children_aliveMethod · 0.95
put_nowaitMethod · 0.45

Tested by

no test coverage detected