aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/pystate.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c5
1 files changed, 5 insertions, 0 deletions
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;