Kuba Mracek
187f772d09
[embedded] Start building embedded stdlib on Windows
2024-06-21 21:32:52 -07:00
Michael Gottesman
d28eef2d62
[sending] Convert the TaskGroup APIs
2024-06-21 06:11:17 -07:00
Michael Gottesman
b541e0299e
[concurrency] Deprecate some source compatibility APIs in swift 5 and obsolete in swift 6.
...
These APIs remained to preserve source compatibility during bringup. We do not
want them used in swift 6 mode... so deprecate in swift 5 and obsolete in swift
6.
2024-06-21 02:24:03 -07:00
Michael Gottesman
4697546e09
[sending] Mark Task.init,detached, and friends as sending methods instead of __owned @Sendable so we can capture non-isolated values.
2024-06-21 02:24:03 -07:00
Konrad `ktoso` Malawski
a43abe6a90
[Concurrency] Remove OPTNONE workaround for old clang version
...
This reverts c07aa9c425 which was done to
avoid a crash in optimnized caused by this PR:
https://github.com/apple/swift/pull/41088
Since this was almost 2 years ago, we probably don't have this issue
anymore as far as I can see other resolved issues, so try to remove the
workaround.
Resolves rdar://88711954
2024-06-20 20:03:33 +09:00
Holly Borla
4bec599931
Merge pull request #74543 from hborla/promote-isolated-any
...
[Features] Promote `IsolatedAny` and its alias to a language feature.
2024-06-19 10:32:30 -07:00
Holly Borla
966269d31a
[Features] Promote IsolatedAny and its alias to a language feature.
...
The proposal is accepted and implemented for Swift 6.0.
2024-06-18 22:09:16 -07:00
Michael Gottesman
05124286c3
Merge pull request #74149 from gottesmm/pr-2808d3e61fa0b5b0dea4b8e7650b69cede701624
...
[concurrency] Mark the global _emptyDequeStorage as nonisolated(unsafe).
2024-06-18 16:42:38 -07:00
Slava Pestov
8582828e7a
Merge pull request #74445 from slavapestov/fix-failure-type-witness
...
Concurrency: Fix default type witness for AsyncSequence.Failure
2024-06-17 17:09:06 -04:00
Konrad `ktoso` Malawski
8a2e755b9a
GlobalActor documentation typos fixup ( #74467 )
...
Co-authored-by: Holly Borla <hborla@apple.com >
2024-06-16 22:28:54 -07:00
Slava Pestov
61d00cacd6
Concurrency: Fix default type witness for AsyncSequence.Failure
...
Setting this to Self.AsyncIterator.Failure doesn't work because
we replace it with its reduced type Self.Failure, and then if
you run a binary compiled against an older version of the stdlib
that does not declare the Failure associated type, we hit
infinite recursion while instantiating the witness table and
trying to populate the default type witness.
Instead, let's set the default to `any Error`. Associated type
inference is already smart enough to infer the type witness from
the AsyncIterator's Failure type; we don't need to rely on the
default mechanism for that.
Fixes rdar://129605725.
2024-06-14 22:43:49 -04:00
Konrad `ktoso` Malawski
2ec717b115
[Concurrency] TaskExecutor ownership fixes ( #74000 )
2024-06-14 22:56:33 +09:00
Konrad `ktoso` Malawski
0cf67e4cdf
Merge pull request #74319 from ktoso/wip-global-custom-exec-docs
2024-06-14 14:48:36 +09:00
Doug Gregor
c5a77fcce5
Add a proper TaskGroup.Iterator.next(isolation:)
...
Implement this function to pass the isolation through to the task group's
`next(isolation:)`. Fixes rdar://129690995.
2024-06-12 15:57:40 -07:00
Konrad `ktoso` Malawski
fe66c47b8a
[docs] Provide more documentation on custom executors with global actors
...
It could be confusing to adopters who were led to believe by the types
that they should "just" implement the sharedUnownedExecutor property,
but insead they have to implement the unownedExecutor on the specific
actor type.
Adding documentation clarify this as well as a simple test that
exercises this explicitly; We seem to have much coverage of main actor,
but not so much of custom executor global actors.
2024-06-12 12:28:55 +09:00
Konrad `ktoso` Malawski
f245ecf45c
[TaskGroup] Fix typo in code snippet
2024-06-10 18:29:38 +09:00
Konrad `ktoso` Malawski
0135623d9a
[docs] fix typo in type name in code snippet
2024-06-10 17:21:47 +09:00
Konrad `ktoso` Malawski
d8cba034b3
[docs] remove swift style code highlighting on non-swift snippet
2024-06-10 17:20:57 +09:00
Konrad `ktoso` Malawski
cd0b3f0d4d
[docs] Remove line in Task docs that is an error in Swift 6 mode
2024-06-10 17:19:57 +09:00
Alex Lorenz
c8b5344d3e
Merge pull request #72014 from compnerd/android
...
utils: support building android SDKs on Windows
2024-06-07 12:37:00 -07:00
Michael Gottesman
db66a207e1
Merge pull request #74151 from gottesmm/pr-89c1f2ab73ad928c312b9bdddb9e2c5cb550439c
...
[concurrency] Update withUnsafe{,Throwing}Continuation to have a sending result.
2024-06-05 20:06:09 -07:00
Alex Lorenz
5aa63fc93e
Merge pull request #72634 from hyp/eng/android/ndk-overlay
...
[android] add an Android NDK Swift overlay
2024-06-05 19:35:13 -07:00
Michael Gottesman
5db3b70c65
[concurrency] Update withUnsafe{,Throwing}Continuation to have a sending result.
...
rdar://129299180
2024-06-05 12:50:59 -07:00
Michael Gottesman
7e8daa80cd
[concurrency] Mark the global _emptyDequeStorage as nonisolated(unsafe).
...
We just use it as a way to initialize values. We will always just read from it
and copy from it.
2024-06-05 12:03:57 -07:00
Konrad `ktoso` Malawski
4fc0f3ab61
Merge pull request #73634 from ktoso/wip-document-exexecutors-apidoc
2024-06-05 06:27:46 +09:00
Konrad `ktoso` Malawski
89adc8293c
[Docs] Minor rewording of Task docs, easier to read
2024-06-04 15:42:04 +09:00
Konrad `ktoso` Malawski
2182dce8b7
[Concurrency] Document custom executors in API docs a bit
...
Include review feedback and show how to customize a single actor by
passing an executor through initializer
2024-06-04 15:42:02 +09:00
Konrad `ktoso` Malawski
083fdaa0de
Merge pull request #73998 from nickolas-pohilets/mpokhylets/fix-32-build
2024-06-04 13:49:19 +09:00
Konrad `ktoso` Malawski
14b8546392
[Concurrency] Don't add new task locals copy runtime func
2024-06-03 13:55:02 +09:00
Michael Gottesman
ce1dd43395
[sending] Change CheckedContinuation/AsyncThrowingStream.Continuation APIs to use sending parameters and results.
...
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
2024-06-01 23:25:16 -07:00
Konrad `ktoso` Malawski
0c44645832
[Concurrency] Implement defensive copying in task groups, rather than crashing ( #73978 )
2024-05-31 11:27:03 -07:00
Mykola Pokhylets
987b641a7c
Updated HeaderFooterLayout to correctly handle empty Header or Footer
2024-05-30 21:56:28 +02:00
Mykola Pokhylets
a891b8f0fb
Move isDistributedRemoteActor outside #if
2024-05-30 21:55:58 +02:00
Mike Ash
7427aa5f48
[Concurrency] Remove SWIFT_ENABLE_ASYNC_JOB_DISPATCH_INTEGRATION environment variable.
...
This option serves no purpose anymore and this dispatch integration should always be enabled.
2024-05-30 12:43:19 -04:00
Holly Borla
135e3f2ee9
Merge pull request #73889 from hborla/deprecate-anyactor
...
[Concurrency] Deprecate `AnyActor`.
2024-05-30 09:36:35 -07:00
Mykola Pokhylets
b5e039d1e0
Fixed 32-bit build with SWIFT_CONCURRENCY_ENABLE_PRIORITY_ESCALATION
2024-05-30 13:15:39 +02:00
Mykola Pokhylets
6298d41edf
Reapply "Fix quadratic performance of the ListMerger in specific usage pattern"
...
This reverts commit 2640ff613b .
2024-05-30 13:08:42 +02:00
Holly Borla
c20b0e0956
[Concurrency] Obsolete AnyActor in Swift 6 using a typealias.
2024-05-29 22:59:19 -07:00
John McCall
a8d163bb23
Merge pull request #73966 from rjmccall/condvar-await-scope
...
Fix a bug with task-to-thread continuations
2024-05-29 18:56:51 -04:00
Mike Ash
d0ed6f6ba2
Merge pull request #73945 from mikeash/dispatch-async-swift-job-no-dlsym
...
[Concurrency] Reference dispatch_async_swift_job directly when the header is available.
2024-05-29 14:25:55 -04:00
John McCall
d3e7b5116f
In the task-to-thread model of UnsafeContinuation, destroy the
...
condvar before we try to tail-call. This is necessary because the
swiftasync tail-call handling is (reasonably) reluctant to reorder
cleanups so that locals are destroyed before the call, and of course it
cannot destroy them after it and still emit a tail call.
Old versions of clang handled these tailcalls differently and failed
to diagnose this, but I'm pretty sure they just ended up not doing a
tail call rather than actually doing anything reasonable.
Fixes rdar://125363169
2024-05-28 22:04:50 -04:00
Konrad `ktoso` Malawski
a664c02f60
Merge pull request #73934 from ktoso/pick-concurrency-isCurrent-more-fixes
2024-05-29 10:07:53 +09:00
Mike Ash
c396f75792
[Concurrency] Reference dispatch_async_swift_job directly when the header is available.
...
Only use dlsym when we don't have the header, since it's an unnecessary performance hit.
rdar://118465481
2024-05-28 17:35:39 -04:00
Alex Lorenz
57b89d5303
[android] add an android NDK Swift overlay module, and use it instead of Glibc
2024-05-28 12:57:38 -07:00
Konrad `ktoso` Malawski
7c0e1f599a
[Concurrency] Fix embedded, cannot refer to runtime/env vars from Actor.cpp
2024-05-28 18:19:55 +09:00
Konrad `ktoso` Malawski
e9b25d1091
[Concurrency] Move innermost record assertion to handle more gracefully
2024-05-28 16:58:38 +09:00
Konrad `ktoso` Malawski
153806b71a
[Concurrency] Reshape initial values of executor checking so tests pass on Linux
2024-05-27 17:02:26 +09:00
Konrad `ktoso` Malawski
d36f99540c
[Concurrency] Always assume that if expecting main actor and are on main thread that this is equal
2024-05-27 17:02:26 +09:00
Konrad `ktoso` Malawski
7790609fc8
[Concurrency] Futher prevent crashes in legacy mode of isCurrentExecutor
2024-05-27 17:02:26 +09:00
Konrad `ktoso` Malawski
481c928d67
[Concurrency] Fix missing return in legacy isSameExecutor mode detection
...
resolves rdar://128425368
resolves rdar://127400013
2024-05-27 17:02:25 +09:00