[all-commits] [llvm/llvm-project] a91921: [libc] Remove cross-entrypoint dependencies from p...
Pavel Labath via All-commits
all-commits at lists.llvm.org
Wed Sep 23 01:11:20 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a91921eda070d6903896432802845222e49e9713
https://github.com/llvm/llvm-project/commit/a91921eda070d6903896432802845222e49e9713
Author: Pavel Labath <pavel at labath.sk>
Date: 2026-09-23 (Wed, 23 Sep 2026)
Changed paths:
M libc/src/pthread/CMakeLists.txt
A libc/src/pthread/pthread_attr.h
M libc/src/pthread/pthread_attr_init.cpp
M libc/src/pthread/pthread_create.cpp
Log Message:
-----------
[libc] Remove cross-entrypoint dependencies from pthread_create (#225383)
pthread_create was previously calling public entrypoints
(pthread_attr_init, pthread_attr_destroy, pthread_attr_getstack,
pthread_attr_getguardsize, pthread_attr_getdetachstate), which violates
the rule against internal cross-entrypoint dependencies.
To fix this, I create an internal header (src/pthread/pthread_attr.h)
defining DEFAULT_PTHREAD_ATTR, modeled after DEFAULT_MUTEXATTR in the
mutex code.
pthread_create now defaults to &DEFAULT_PTHREAD_ATTR when the attr
pointer is null, and accesses the struct members directly instead of
going through getter functions. This also makes it clear that getting
the values cannot fail. I also update pthread_attr_init to reuse
DEFAULT_PTHREAD_ATTR to avoid duplicating the default values.
While in there, update the includes to use proxy headers instead of
including <pthread.h> directly, and drop the dependency on errno since
pthread_create returns errors directly rather than setting errno.
Assisted-by: Gemini
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