diff options
author | Gabriele N. Tornetta <P403n1x87@users.noreply.github.com> | 2021-05-26 14:40:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-26 14:40:14 (GMT) |
commit | 90a6c07cb20114dda801f027a90df839225751cb (patch) | |
tree | 3ed985b2de44bd7bc7a75190a9e9a62e2ed0d7cb /Modules | |
parent | 4f725261c6cf23d259e8fdc205e12b76ef4d2d31 (diff) | |
download | cpython-90a6c07cb20114dda801f027a90df839225751cb.zip cpython-90a6c07cb20114dda801f027a90df839225751cb.tar.gz cpython-90a6c07cb20114dda801f027a90df839225751cb.tar.bz2 |
bpo-43879: Add native_thread_id field to PyThreadState (GH-25458)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_threadmodule.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index 6924d65..d4d5c0a 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -1071,6 +1071,11 @@ thread_run(void *boot_raw) tstate = boot->tstate; 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 _PyThreadState_Init(tstate); PyEval_AcquireThread(tstate); tstate->interp->num_threads++; |