mirror of
https://github.com/python/cpython.git
synced 2025-10-15 03:10:29 +00:00
gh-119333: Add C api to have contextvar enter/exit callbacks (#119335)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
This commit is contained in:
parent
ad7c778546
commit
d87482bc4e
10 changed files with 402 additions and 0 deletions
|
@ -906,6 +906,11 @@ interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate)
|
|||
interp->code_watchers[i] = NULL;
|
||||
}
|
||||
interp->active_code_watchers = 0;
|
||||
|
||||
for (int i=0; i < CONTEXT_MAX_WATCHERS; i++) {
|
||||
interp->context_watchers[i] = NULL;
|
||||
}
|
||||
interp->active_context_watchers = 0;
|
||||
// XXX Once we have one allocator per interpreter (i.e.
|
||||
// per-interpreter GC) we must ensure that all of the interpreter's
|
||||
// objects have been cleaned up at the point.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue