| 868 | return _chain_from_iterable_of_lists(results) |
| 869 | |
| 870 | def shutdown(self, wait=True, *, cancel_futures=False): |
| 871 | with self._shutdown_lock: |
| 872 | self._cancel_pending_futures = cancel_futures |
| 873 | self._shutdown_thread = True |
| 874 | if self._executor_manager_thread_wakeup is not None: |
| 875 | # Wake up queue management thread |
| 876 | self._executor_manager_thread_wakeup.wakeup() |
| 877 | |
| 878 | if self._executor_manager_thread is not None and wait: |
| 879 | self._executor_manager_thread.join() |
| 880 | # To reduce the risk of opening too many files, remove references to |
| 881 | # objects that use file descriptors. |
| 882 | self._executor_manager_thread = None |
| 883 | self._call_queue = None |
| 884 | if self._result_queue is not None and wait: |
| 885 | self._result_queue.close() |
| 886 | self._result_queue = None |
| 887 | self._processes = None |
| 888 | self._executor_manager_thread_wakeup = None |
| 889 | |
| 890 | shutdown.__doc__ = _base.Executor.shutdown.__doc__ |
| 891 | |