[libc-commits] [libc] [libc] Add an extension macro to get numerical thread id (PR #195202)
Alexey Samsonov via libc-commits
libc-commits at lists.llvm.org
Fri May 1 09:22:32 PDT 2026
================
@@ -77,4 +79,7 @@
#define PTHREAD_RWLOCK_PREFER_WRITER_NP 1
#define PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP 2
+// LLVM libc extensions
+#define __PTHREAD_GET_ID(t) (reinterpret_cast<uintptr_t>((t).__attrib))
----------------
vonosmas wrote:
Good point! Let me work on a test verifying that our <pthread.h> can be included in the plain C programs, I think I already had to fix one of the issues before (45b1a4bb8d0f77a336730c9da7f15820c2869611), would be good to check it continuously.
https://github.com/llvm/llvm-project/pull/195202
More information about the libc-commits
mailing list