The existing thrd_once function has been refactored so that the
implementation can be shared between thrd_once and pthread_once
functions.
Details
Details
- Reviewers
michaelrj - Commits
- rG336753901087: [libc] Add implementation of pthread_once.
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Overall LGTM
libc/src/__support/threads/linux/callonce.cpp | ||
---|---|---|
47 | you just defined status to be START, so this condition seems like it can never be true. |
libc/src/__support/threads/linux/callonce.cpp | ||
---|---|---|
47 | If compare_exchange_strong fails, it will write the current value of futex_word into status (which is a reference parameter to compare_exchange_strong. |
libc/src/__support/threads/linux/callonce.cpp | ||
---|---|---|
47 | ah, that makes sense. LGTM |
you just defined status to be START, so this condition seems like it can never be true.