MCPcopy Index your code
hub / github.com/python/cpython / _pause_threads

Function _pause_threads

Lib/profiling/sampling/sample.py:19–28  ·  view source on GitHub ↗

Context manager to pause/resume threads around sampling if blocking is True.

(unwinder, blocking)

Source from the content-addressed store, hash-verified

17
18@contextlib.contextmanager
19def _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
31from .constants import (

Callers 1

sampleMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…