From 90a6c07cb20114dda801f027a90df839225751cb Mon Sep 17 00:00:00 2001 From: "Gabriele N. Tornetta" Date: Wed, 26 May 2021 15:40:14 +0100 Subject: bpo-43879: Add native_thread_id field to PyThreadState (GH-25458) --- Python/pystate.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Python') diff --git a/Python/pystate.c b/Python/pystate.c index 64dcd577a0f..4a3cb24a199 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -645,6 +645,11 @@ new_threadstate(PyInterpreterState *interp, int init) tstate->gilstate_counter = 0; tstate->async_exc = NULL; tstate->thread_id = PyThread_get_thread_ident(); +#ifdef PY_HAVE_THREAD_NATIVE_ID + tstate->native_thread_id = PyThread_get_thread_native_id(); +#else + tstate->native_thread_id = 0; +#endif tstate->dict = NULL; -- cgit v1.2.3