Internal thread runner.
(self, fn, args, kwargs)
| 412 | self._shutdown = True |
| 413 | |
| 414 | def _worker_run(self, fn, args, kwargs): |
| 415 | """Internal thread runner.""" |
| 416 | self._lock.acquire() |
| 417 | tid = threading.get_ident() |
| 418 | if tid not in self._worker_map: |
| 419 | proc = PopenWorker( |
| 420 | self._initializer, |
| 421 | self._initargs, |
| 422 | self._maximum_process_uses, |
| 423 | self._stdout, |
| 424 | self._stderr, |
| 425 | ) |
| 426 | self._worker_map[tid] = proc |
| 427 | else: |
| 428 | proc = self._worker_map[tid] |
| 429 | self._lock.release() |
| 430 | |
| 431 | proc.send(fn, args, kwargs, self._timeout) |
| 432 | return proc.recv() |
| 433 | |
| 434 | def _worker_run_with_error_catching(self, fn, args, kwargs) -> MapResult: |
| 435 | # pylint: disable=broad-except |
no test coverage detected