diff options
author | Richard Hansen <rhansen@rhansen.org> | 2024-10-12 19:33:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-12 19:33:00 (GMT) |
commit | 62d5a53a0b2a5262a86984cfe9817aeb653ebfca (patch) | |
tree | dd88317e746c13236c545f054ea8939d0ece4bd4 /Python/context.c | |
parent | c05f9dde8a12dfd63d3ade93da616042df2dc925 (diff) | |
download | cpython-62d5a53a0b2a5262a86984cfe9817aeb653ebfca.zip cpython-62d5a53a0b2a5262a86984cfe9817aeb653ebfca.tar.gz cpython-62d5a53a0b2a5262a86984cfe9817aeb653ebfca.tar.bz2 |
gh-124872: Move PyThreadState to first argument for consistency (#124774)
Diffstat (limited to 'Python/context.c')
-rw-r--r-- | Python/context.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Python/context.c b/Python/context.c index 36e2677..9b74213 100644 --- a/Python/context.c +++ b/Python/context.c @@ -112,7 +112,8 @@ context_event_name(PyContextEvent event) { 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); PyInterpreterState *interp = ts->interp; @@ -192,7 +193,7 @@ _PyContext_Enter(PyThreadState *ts, PyObject *octx) ts->context = Py_NewRef(ctx); ts->context_ver++; - notify_context_watchers(Py_CONTEXT_EVENT_ENTER, ctx, ts); + notify_context_watchers(ts, Py_CONTEXT_EVENT_ENTER, ctx); return 0; } @@ -226,7 +227,7 @@ _PyContext_Exit(PyThreadState *ts, PyObject *octx) 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); ts->context_ver++; |