]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-110481: Fix _Py_ThreadId for non-free-threaded mode (gh-111503)
authorDonghee Na <donghee.na@python.org>
Mon, 30 Oct 2023 17:16:18 +0000 (02:16 +0900)
committerGitHub <noreply@github.com>
Mon, 30 Oct 2023 17:16:18 +0000 (02:16 +0900)
Include/object.h

index 6f116ef35a790c627f4631b8b5b2699a96546c88..1c7d7f407fe23ea12650740fcbb52e021f6fbc7c 100644 (file)
@@ -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)
 {