| 399 | self._suspend_time_request = self._next_request_time() |
| 400 | |
| 401 | def on_pause(self): |
| 402 | # Upon a pause, we should force sending new suspend notifications |
| 403 | # if no notification is sent after some time and there's some thread already stopped. |
| 404 | with self._lock: |
| 405 | self._pause_requested = True |
| 406 | global_suspend_time = self._suspend_time_request |
| 407 | py_db = self._py_db() |
| 408 | if py_db is not None: |
| 409 | py_db.timeout_tracker.call_on_timeout( |
| 410 | self.NOTIFY_OF_PAUSE_TIMEOUT, self._notify_after_timeout, kwargs={"global_suspend_time": global_suspend_time} |
| 411 | ) |
| 412 | |
| 413 | def _notify_after_timeout(self, global_suspend_time): |
| 414 | with self._lock: |