]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-124872: Move PyThreadState to first argument for consistency (#124774)
authorRichard Hansen <rhansen@rhansen.org>
Sat, 12 Oct 2024 19:33:00 +0000 (15:33 -0400)
committerGitHub <noreply@github.com>
Sat, 12 Oct 2024 19:33:00 +0000 (12:33 -0700)
Python/context.c

index 36e2677c398f591464e88203cd4125881a67fd0b..9b742136b0726d87c562cd1ebe4188c7c2159ae7 100644 (file)
@@ -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++;