Skip to content

Commit c744dbe

Browse files
authored
gh-112535: Update _Py_ThreadId() to support s390/s390x (gh-112751)
1 parent e6ac254 commit c744dbe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Include/object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ _Py_ThreadId(void)
279279
__asm__ ("" : "=r" (tp));
280280
tid = tp;
281281
#endif
282+
#elif defined(__s390__) && defined(__GNUC__)
283+
// Both GCC and Clang have supported __builtin_thread_pointer
284+
// for s390 from long time ago.
285+
tid = (uintptr_t)__builtin_thread_pointer();
282286
#else
283287
# error "define _Py_ThreadId for this platform"
284288
#endif

0 commit comments

Comments
 (0)