Add Linux support using Synchronization.Mutex - #74
Merged
Merged
Conversation
Preserve shared critical-state ownership with a reference-backed Mutex wrapper and compiler-checked Sendable conformance. Remove the unused Combine test import and make Dispatch explicit. Require Swift 6.1 and iOS/tvOS 18, macOS 15, and watchOS 11 while retaining Swift 5 language mode. Swift 6.0.3 crashes when compiling generic Mutex storage in Linux debug builds. Add Ubuntu CI for Swift 6.1.3 and 6.4.0 and verify throwing critical regions release the lock. All 200 tests and release builds passed on macOS and Linux arm64.
This was referenced Oct 4, 2026
Contributor
|
Great. Can you tag a release? Thank you, I'm very happy not to have to maintain a fork anymore. |
Contributor
Author
|
Done -> 0.7 |
Contributor
Legend. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Enable AsyncExtensions builds and tests on Linux by replacing Darwin-only locking with
Synchronization.Mutex. A reference-backedManagedCriticalStatepreserves shared state between iterator copies and callbacks, with compiler-checked conditionalSendableconformance. Remove the unused Combine test import and import Dispatch explicitly for the buffered timer.Breaking requirements: Swift 6.1+, iOS/tvOS 18+, macOS 15+, and watchOS 11+. Swift 5 language mode is retained. Swift 6.0.3 was excluded after reproducing a compiler crash in generic Mutex initialization during Linux debug builds.
Add Ubuntu 22.04 CI with Swift 6.1.3 and 6.4.0, document Linux usage, and test that throwing critical regions preserve mutations and release the lock. Make the lazy-sequence cancellation test await its child task so XCTest finishes after all expectations and assertions complete. Related: #38.
Validation
3b41b88: Ubuntu 22.04 x86_64 release builds and all 200 tests passed on Swift 6.1.3 and 6.4.0; macOS build and test jobs also passed, in both push and pull-request workflows. PR workflow results.git diff --checkpassed.Checklist