[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
Tue May 5 12:54:02 PDT 2026
vonosmas wrote:
> Both glibc and musl appear to cast the thread pointer to the TCB to unsigned long and use that as the value of pthread_t, which avoids exposing internals, structs, or anything else. Do we have a need to do anything different? I think I'm missing what problem this is trying to solve.
I think that's what this PR is effectively doing as well? Only instead of having `typedef unsigned long pthread_t;` in public header, we ask the caller to call a private API to get an integer representation of opaque pthread_t.
https://github.com/llvm/llvm-project/pull/195202
More information about the libc-commits
mailing list