Skip to content

Commit

Permalink
Merge branch 'gh-119333-notify' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
rhansen committed Sep 30, 2024
2 parents e4c27e4 + efab225 commit ebac569
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Python/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -195,7 +196,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;
}

Expand Down Expand Up @@ -229,7 +230,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++;

Expand Down

0 comments on commit ebac569

Please sign in to comment.