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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions stdlib/public/Observation/Sources/Observation/Locking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ internal struct Lock {
#if canImport(Darwin)
typealias Primitive = os_unfair_lock
#elseif canImport(Glibc) || canImport(Musl) || canImport(Bionic)
#if os(FreeBSD) || os(OpenBSD)
// BSD libc does not annotate the nullability of pthread APIs.
// We should replace this with the appropriate API note in the platform
// overlay.
// https://github.com/swiftlang/swift/issues/81407
typealias Primitive = pthread_mutex_t?
#else
typealias Primitive = pthread_mutex_t
#endif
#elseif canImport(WinSDK)
typealias Primitive = SRWLOCK
#elseif arch(wasm32)
Expand Down