From: Donghee Na Date: Mon, 30 Oct 2023 17:16:18 +0000 (+0900) Subject: gh-110481: Fix _Py_ThreadId for non-free-threaded mode (gh-111503) X-Git-Tag: v3.13.0a2~277 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=55df2deb1aeb182f30026bde5e8b5ea575a2dab8;p=thirdparty%2FPython%2Fcpython.git gh-110481: Fix _Py_ThreadId for non-free-threaded mode (gh-111503) --- diff --git a/Include/object.h b/Include/object.h index 6f116ef35a79..1c7d7f407fe2 100644 --- a/Include/object.h +++ b/Include/object.h @@ -231,7 +231,7 @@ typedef struct { PyAPI_FUNC(int) Py_Is(PyObject *x, PyObject *y); #define Py_Is(x, y) ((x) == (y)) -#ifndef Py_LIMITED_API +#if defined(Py_NOGIL) && !defined(Py_LIMITED_API) static inline uintptr_t _Py_ThreadId(void) { @@ -259,9 +259,7 @@ _Py_ThreadId(void) #endif return tid; } -#endif -#if defined(Py_NOGIL) && !defined(Py_LIMITED_API) static inline Py_ALWAYS_INLINE int _Py_IsOwnedByCurrentThread(PyObject *ob) {