This is an archive of the discontinued LLVM Phabricator instance.

[libc] Keep all thread state information separate from the thread structure.
ClosedPublic

Authored by sivachandra on May 31 2022, 12:05 PM.

Details

Summary

The state is now stored on the thread's stack memory. This enables
implementing pthread API like pthread_detach which takes the pthread_t
structure argument by value.

Diff Detail

Event Timeline

sivachandra created this revision.May 31 2022, 12:05 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 31 2022, 12:05 PM
sivachandra requested review of this revision.May 31 2022, 12:05 PM
lntue accepted this revision.May 31 2022, 10:13 PM
lntue added inline comments.
libc/src/__support/threads/linux/thread.h
98

Shall this class use the same alignment constant as in thread_attrib.h or are they independent?

This revision is now accepted and ready to land.May 31 2022, 10:13 PM

Remove an unnecessary alignment spec.

sivachandra added inline comments.Jun 1 2022, 12:58 AM
libc/src/__support/threads/linux/thread.h
98

Ah, good catch! This should not be required here at all. I was playing with different combinations and forgot to remove this. Removed now.

lntue accepted this revision.Jun 1 2022, 6:12 AM