gh-110481: Fix _Py_ThreadId for non-free-threaded mode (gh-111503)

This commit is contained in:
Donghee Na 2023-10-31 02:16:18 +09:00 committed by GitHub
parent bca3305429
commit 55df2deb1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -231,7 +231,7 @@ typedef struct {
PyAPI_FUNC(int) Py_Is(PyObject *x, PyObject *y); PyAPI_FUNC(int) Py_Is(PyObject *x, PyObject *y);
#define Py_Is(x, y) ((x) == (y)) #define Py_Is(x, y) ((x) == (y))
#ifndef Py_LIMITED_API #if defined(Py_NOGIL) && !defined(Py_LIMITED_API)
static inline uintptr_t static inline uintptr_t
_Py_ThreadId(void) _Py_ThreadId(void)
{ {
@ -259,9 +259,7 @@ _Py_ThreadId(void)
#endif #endif
return tid; return tid;
} }
#endif
#if defined(Py_NOGIL) && !defined(Py_LIMITED_API)
static inline Py_ALWAYS_INLINE int static inline Py_ALWAYS_INLINE int
_Py_IsOwnedByCurrentThread(PyObject *ob) _Py_IsOwnedByCurrentThread(PyObject *ob)
{ {