[all-commits] [llvm/llvm-project] 3a8568: [Support] Teach llvm::thread about thread-id handl...

Alexey Samsonov via All-commits all-commits at lists.llvm.org
Wed Jul 8 07:44:09 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3a85687f4bd34e10e43b65c6ce6b29b980705efc
      https://github.com/llvm/llvm-project/commit/3a85687f4bd34e10e43b65c6ce6b29b980705efc
  Author: Alexey Samsonov <vonosmas at gmail.com>
  Date:   2026-07-08 (Wed, 08 Jul 2026)

  Changed paths:
    M llvm/include/llvm/Support/thread.h
    M llvm/lib/Support/Unix/Threading.inc

  Log Message:
  -----------
  [Support] Teach llvm::thread about thread-id handling in LLVM-libc. (#207918)

This PR matches the libc++ update from
https://github.com/llvm/llvm-project/pull/198595 and applies similar
changes to `llvm::thread` class. Please see the discussion in that PR
(and linked references to other PRs) for more background / discussions.

`llvm::thread` has methods for extracting integer IDs from running
threads, and as such it needs to know what types are used to represent
those integer IDs - something that e.g. pthreads or C11 threads don't
specify. It assumes that `pthread_t` can be used both as a handle and as
a thread-id on most platforms, with the exception of zOS, where the
custom code is written. In LLVM-libc `pthread_t` is not an integral
type, but today it provides `pthread_id_np_t` type and
`pthread_getunique_np` / `pthread_getthreadid_np` methods as extensions
to extract the integer IDs. Use these methods when building against
LLVM-libc.

This is one of few remaining blockers for building LLVM+Clang on top of
LLVM-libc (https://github.com/llvm/llvm-project/issues/97191).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list