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

support pthread primitives on FreeBSD #3886

Merged
merged 4 commits into from
Sep 15, 2024
Merged

Conversation

RalfJung
Copy link
Member

Fixes #3571: makes out pthread implementation support FreeBSD.

FreeBSD sets PHTREAD_MUTEX_DEFAULT == PHTREAD_MUTEX_ERRORCK, so the logic for handling "default vs explicitly set mutex kind" had to be adjusted.

The rest is just some general cleanup of the pthread logic, and I realized that we can enable the std::sync tests on Solarish.

On FreeBSD, DEFAULT maps to ERRORCK. This clashes with the existing PTHREAD_MUTEX_NORMAL_FLAG:
hack so we replace it by a different hack that works better cross-platform.

Also fix a case of "accidental early UB" in a UB test -- pthread_mutexattr_t must be initialized.
@RalfJung
Copy link
Member Author

@bors r+

@bors
Copy link
Contributor

bors commented Sep 15, 2024

📌 Commit 548282d has been approved by RalfJung

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Sep 15, 2024

⌛ Testing commit 548282d with merge dc071a5...

@bors
Copy link
Contributor

bors commented Sep 15, 2024

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing dc071a5 to master...

@bors bors merged commit dc071a5 into rust-lang:master Sep 15, 2024
8 checks passed
@RalfJung RalfJung deleted the freebsd-pthread branch September 15, 2024 11:15
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.

FreeBSD: implement support for pthread synchronization primitives
2 participants