Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc] add rwlock #94156

Merged
merged 33 commits into from
Jun 14, 2024
Merged

[libc] add rwlock #94156

merged 33 commits into from
Jun 14, 2024

Conversation

SchrodingerZhu
Copy link
Contributor

@SchrodingerZhu SchrodingerZhu commented Jun 2, 2024

This PR adds pthread_rwlock_XXX to the llvm-libc.

Copy link

github-actions bot commented Jun 2, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@SchrodingerZhu SchrodingerZhu force-pushed the libc/rwlock-part-1 branch 2 times, most recently from 74bdda6 to 88fcb9d Compare June 3, 2024 04:11
@SchrodingerZhu SchrodingerZhu marked this pull request as ready for review June 3, 2024 05:27
libc/spec/posix.td Outdated Show resolved Hide resolved
libc/spec/spec.td Outdated Show resolved Hide resolved
libc/src/__support/threads/linux/rwlock.h Outdated Show resolved Hide resolved
libc/src/__support/threads/linux/rwlock.h Outdated Show resolved Hide resolved
libc/src/__support/threads/linux/rwlock.h Outdated Show resolved Hide resolved
libc/src/__support/threads/linux/rwlock.h Outdated Show resolved Hide resolved
libc/src/__support/threads/linux/rwlock.h Outdated Show resolved Hide resolved
libc/src/__support/threads/linux/rwlock.h Outdated Show resolved Hide resolved
libc/src/__support/threads/linux/rwlock.h Outdated Show resolved Hide resolved
@SchrodingerZhu
Copy link
Contributor Author

There seem to be some bugs.
@QuarticCat could you take a look? I will also be debugging this tomorrow.

@SchrodingerZhu
Copy link
Contributor Author

fixed. It took me a while to notice that misplaced brace ....

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests look good overall, but make sure you're careful when using randomness in tests. A test failure isn't helpful if you can't figure out what caused it.

libc/include/llvm-libc-types/pthread_rwlock_t.h Outdated Show resolved Hide resolved
libc/src/__support/threads/linux/rwlock.h Outdated Show resolved Hide resolved
libc/src/pthread/pthread_rwlock_init.cpp Outdated Show resolved Hide resolved
libc/test/integration/src/pthread/pthread_rwlock_test.cpp Outdated Show resolved Hide resolved
Copy link

@QuarticCat QuarticCat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm uncertain about memory ordering choices. Other parts look good to me.

libc/src/__support/threads/linux/rwlock.h Outdated Show resolved Hide resolved
libc/src/__support/threads/linux/rwlock.h Outdated Show resolved Hide resolved
libc/src/__support/threads/linux/rwlock.h Outdated Show resolved Hide resolved
libc/src/__support/threads/linux/rwlock.h Outdated Show resolved Hide resolved
libc/src/__support/threads/linux/rwlock.h Outdated Show resolved Hide resolved
@SchrodingerZhu SchrodingerZhu merged commit 41fecca into llvm:main Jun 14, 2024
7 checks passed
@SchrodingerZhu SchrodingerZhu deleted the libc/rwlock-part-1 branch June 14, 2024 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants