mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-124872: Move PyThreadState to first argument for consistency (#124774)
This commit is contained in:
parent
c05f9dde8a
commit
62d5a53a0b
1 changed files with 4 additions and 3 deletions
|
@ -112,7 +112,8 @@ context_event_name(PyContextEvent event) {
|
||||||
Py_UNREACHABLE();
|
Py_UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void notify_context_watchers(PyContextEvent event, PyContext *ctx, PyThreadState *ts)
|
static void
|
||||||
|
notify_context_watchers(PyThreadState *ts, PyContextEvent event, PyContext *ctx)
|
||||||
{
|
{
|
||||||
assert(Py_REFCNT(ctx) > 0);
|
assert(Py_REFCNT(ctx) > 0);
|
||||||
PyInterpreterState *interp = ts->interp;
|
PyInterpreterState *interp = ts->interp;
|
||||||
|
@ -192,7 +193,7 @@ _PyContext_Enter(PyThreadState *ts, PyObject *octx)
|
||||||
ts->context = Py_NewRef(ctx);
|
ts->context = Py_NewRef(ctx);
|
||||||
ts->context_ver++;
|
ts->context_ver++;
|
||||||
|
|
||||||
notify_context_watchers(Py_CONTEXT_EVENT_ENTER, ctx, ts);
|
notify_context_watchers(ts, Py_CONTEXT_EVENT_ENTER, ctx);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,7 +227,7 @@ _PyContext_Exit(PyThreadState *ts, PyObject *octx)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
notify_context_watchers(Py_CONTEXT_EVENT_EXIT, ctx, ts);
|
notify_context_watchers(ts, Py_CONTEXT_EVENT_EXIT, ctx);
|
||||||
Py_SETREF(ts->context, (PyObject *)ctx->ctx_prev);
|
Py_SETREF(ts->context, (PyObject *)ctx->ctx_prev);
|
||||||
ts->context_ver++;
|
ts->context_ver++;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue