(self)
| 84 | self._poll_count = 0 |
| 85 | |
| 86 | def __enter__(self): |
| 87 | self._monitor_thread = threading.Thread( |
| 88 | target=self._monitor_loop, |
| 89 | daemon=True, |
| 90 | name=f"child-monitor-{self.parent_pid}", |
| 91 | ) |
| 92 | self._monitor_thread.start() |
| 93 | return self |
| 94 | |
| 95 | def __exit__(self, exc_type, exc_val, exc_tb): |
| 96 | self._stop_event.set() |