Context manager to pause/resume threads around sampling if blocking is True.
(unwinder, blocking)
| 17 | |
| 18 | @contextlib.contextmanager |
| 19 | def _pause_threads(unwinder, blocking): |
| 20 | """Context manager to pause/resume threads around sampling if blocking is True.""" |
| 21 | if blocking: |
| 22 | unwinder.pause_threads() |
| 23 | try: |
| 24 | yield |
| 25 | finally: |
| 26 | unwinder.resume_threads() |
| 27 | else: |
| 28 | yield |
| 29 | |
| 30 | |
| 31 | from .constants import ( |
no outgoing calls
no test coverage detected
searching dependent graphs…