From 8a0a8b8eb4f0fbe7388e4933e29307d6e94fa93a Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Tue, 31 Oct 2023 02:16:18 +0900 Subject: [PATCH] gh-110481: Fix _Py_ThreadId for non-free-threaded mode (gh-111503) --- Include/object.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Include/object.h b/Include/object.h index 6f116ef35a790c6..1c7d7f407fe23ea 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) {