Specifically:
1. CheckedContinuation.resume now takes a sending parameter.
2. Async{Throwing,}Stream.yield takes a sending parameter.
3. withCheckedContinuation returns a transferring parameter.
Importantly due to the previous changes around mangling, this is a mangling
neutral change.
rdar://120420024
as warnings.
Marking the closure parameter to these inits as `@Sendable` changed the
inferred isolation of closure arguments in actor-isolated contexts, which
caused new effects checker errors when accessing isolated properties and
methods without `await`. Mark these `init`s as `@preconcurrency`, and fix
the effects checker to downgrade those errors to warnings when the context
of the call is `@preconcurrency`.
Use an optional isolated parameter to this new `next(_:)` overload to
keep it on the same actor as the caller, and pass `#isolation` when
desugaring the async for..in loop. This keeps async iteration loops on
the same actor, allowing non-Sendable values to be used with many
async sequences.
- Revise '// Prints' comments style like the other stdlib files
- Remove verbose string interpolations and extra spaces
- Remove some unneeded parentheses
- Replace the majority of ' : ' with ': '
- Fix wrong indentation
- Keep files with a single empty line at the end
The concurrency runtime now deploys back to macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, which corresponds to the 5.1 release of the stdlib.
Adjust macro usages accordingly.
* Rework YieldingContinuation to service values in a buffered fashion
* Fix word size calculation for locks
* Handle terminal states and finished/failed storage
* Wrap yielding continuation into a more featureful type for better ergonomics
* Hope springs eternal, maybe windows works with this?
* Prevent value overflows at .max limits
* Add a cancellation handler
* Fix series tests missing continuation parameters
* Fix series tests for mutable itertaors
* Rename to a more general name for Series's inner continuation type
* Whitespace fixes and add more commentary about public functions on Series
* Restore YieldingContinuation for now with deprecations to favor Series
* Ensure onCancel is invoked in deinit phases, and eliminate a potential for double cancellation
* Make sure ThrowingSeries has the same nonmutating setter for onCancel as Series
* Add a swath of more unit tests that exersize cancellation behavior as well as throwing behaviors
* Remove work-around for async testing
* Fixup do/catch range to properly handle ThrowingSeries test
* Address naming consistency of resume result function
* Adopt the async main test setup
* More migration of tests to new async mechanisms
* Handle the double finish/throw case
* Ensure the dependency on Dispatch is built for the series tests (due to semaphore usage)
* Add import-libdispatch to run command for Series tests
* Use non-combine based timeout intervals (portable to linux) for dispatch semaphore
* Rename Series -> AsyncStream and resume functions to just yield, and correct a missing default Element.self value
* Fix missing naming change issue for yielding an error on AsyncThrowingStream
* Remove argument label of buffering from tests
* Extract buffer and throwing variants into their own file
* Slightly refactor for only needing to store the producer instead of producer and cancel
* Rename onCancel to onTermination
* Convert handler access into a function pair
* Add finished states to the termination handler event pipeline and a disambiguation enum to identify finish versus cancel
* Ensure all termination happens before event propigation (and outside of the locks) and warn against requirements for locking on terminate and enqueue
* Modified to use Deque to back the storage and move the storage to inner types; overall perf went from 200kE/sec to over 1ME/sec
* Update stdlib/public/Concurrency/AsyncStream.swift
Co-authored-by: Doug Gregor <dgregor@apple.com>
* Update stdlib/public/Concurrency/AsyncThrowingStream.swift
Co-authored-by: Doug Gregor <dgregor@apple.com>
* Update stdlib/public/Concurrency/AsyncStream.swift
Co-authored-by: Joseph Heck <heckj@mac.com>
* Update stdlib/public/Concurrency/AsyncThrowingStream.swift
Co-authored-by: Joseph Heck <heckj@mac.com>
* Update stdlib/public/Concurrency/AsyncThrowingStream.swift
Co-authored-by: Joseph Heck <heckj@mac.com>
* Update stdlib/public/Concurrency/AsyncThrowingStream.swift
Co-authored-by: Joseph Heck <heckj@mac.com>
* Update stdlib/public/Concurrency/AsyncStream.swift
Co-authored-by: Joseph Heck <heckj@mac.com>
* Update stdlib/public/Concurrency/AsyncThrowingStream.swift
Co-authored-by: Joseph Heck <heckj@mac.com>
* Remove local cruft for overlay disabling
* Remove local cruft for Dispatch overlay work
* Remove potential ABI impact for adding Deque
Co-authored-by: Doug Gregor <dgregor@apple.com>
Co-authored-by: Joseph Heck <heckj@mac.com>