[libc-commits] [libc] [libc] Add an extension macro to get numerical thread id (PR #195202)

Petr Hosek via libc-commits libc-commits at lists.llvm.org
Tue May 5 11:49:10 PDT 2026


================
@@ -77,4 +80,8 @@
 #define PTHREAD_RWLOCK_PREFER_WRITER_NP 1
 #define PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP 2
 
+// LLVM libc extensions
+#define __PTHREAD_GET_ID(t)                                                    \
----------------
petrhosek wrote:

I'd suggest making this function macro name lowercase, that gives us a flexibility to turn this into a function in the future if needed without having to change the name.
```suggestion
#define __pthread_get_id(t)                                                    \
```

https://github.com/llvm/llvm-project/pull/195202


More information about the libc-commits mailing list