Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FreeBSD]: Optional observation pthread primitives #81366

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

etcwilde
Copy link
Contributor

@etcwilde etcwilde commented May 7, 2025

The pthread APIs on FreeBSD do not include nullability APIs so the pthread mutex APIs are imported as pointers to optional values. Other platforms include nullability APIs and import the pthread APIs as pointers to the mutex. Splitting the locking primitive type based on the OS.

Fixes: rdar://150880976

The pthread APIs on FreeBSD do not include nullability APIs so the
pthread mutex APIs are imported as pointers to optional values.
Other platforms include nullability APIs and import the pthread APIs as
pointers to the mutex. Splitting the locking primitive type based on the
OS.

Fixes: rdar://150880976
@etcwilde etcwilde requested a review from phausler as a code owner May 7, 2025 21:43
@etcwilde
Copy link
Contributor Author

etcwilde commented May 7, 2025

@swift-ci please test

@stephentyrone
Copy link
Contributor

Longer-term, should we be API-noting these on *BSD?

@@ -34,7 +34,11 @@ internal struct Lock {
#if canImport(Darwin)
typealias Primitive = os_unfair_lock
#elseif canImport(Glibc) || canImport(Musl) || canImport(Bionic)
#if os(FreeBSD)
Copy link
Member

Choose a reason for hiding this comment

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

This is also the case for os(OpenBSD). Can you add this as well?

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