Skip to content

Commit b131d2f

Browse files
committed
Add partial support for FreeBSD
This change will allow `swift build` to succeed. However, SwiftPM support is still incomplete and does not yet allow adding `.freebsd` to `.when(platforms:)`, so `swift test` cannot be executed.
1 parent 24bd5ac commit b131d2f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/AsyncAlgorithms/Locking.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ internal struct Lock {
2929
#if canImport(Darwin)
3030
typealias Primitive = os_unfair_lock
3131
#elseif canImport(Glibc) || canImport(Musl) || canImport(Bionic) || canImport(wasi_pthread)
32+
#if os(FreeBSD) || os(OpenBSD)
33+
typealias Primitive = pthread_mutex_t?
34+
#else
3235
typealias Primitive = pthread_mutex_t
36+
#endif
3337
#elseif canImport(WinSDK)
3438
typealias Primitive = SRWLOCK
3539
#else

0 commit comments

Comments
 (0)