Android should use the dispatch based, Linux platform executor. However,
Android reports as `os(Android)` rather than `os(Linux)`. This adjusts
the condition to ensure that we have a platform executor factory for
Android.
These were split out in #79751. However, this split is not needed for
these. Furthermore, modulemaps have bugs when it comes to re-exporting
some modules, resulting in missing exports.
* [Concurrency] Fix templated code in Task+startSynchronously.swift
rdar://147348183
The gyb code always dropped the `throws` modifier, no matter which case was being processed.
* Update Task+startSynchronously.swift.gyb
* Fix abi tests
Change task ids to be formatted using decimal instead of hex.
An example of previous signposts:
```
task=e resumefn=0x2807722bc jobPriority=0 isChildTask=0, isFuture=1 isGroupChildTask=0 isAsyncLetTask=0 parent=0 group=0x0 asyncLet=0x0
```
this will now show `task=14` instead of `task=e`
Do not rely on the @_unsafeNonescapableResult attribute. That attribute is only
for temporarily working around bugs! And it only affects lifetime diagnostics within
the function. It has no affect on the caller's diagnostics, so it won't solve
this problem:
func macroGeneratedThunk() -> CxxSpan<Int> {
return _unsafeRemoveLifetime(Span...)
}
We cannot simply add @_unsafeRemoveLifetime to the thunk, because SwiftSyntax
does not natively support the attribute. We don't want to add SwiftSyntax
support because this attribute will never be supported syntax!
Instead, use `_overrideLifetime` copying the `Void` type to remove a dependency:
func macroGeneratedThunk() -> CxxSpan<Int> {
return _cxxOverrideLifetime(Span..., copying: ())
}
It's hard to tell why a crash occurred with just "Could not allocate memory." Modify the message to include the size/alignment, which will help distinguish between an actual lack of memory and a request for an excessively large allocation.
While we're in there, add \n to a bunch of other fatal error helper functions that didn't have it.
_swift_taskGroup_cancelAllChildren relies on there being no concurrent modification when called from the owning task, but this is not guaranteed.
Rearrange things to always take the owning task's status record lock when walking the group's children. Split _swift_taskGroup_cancelAllChildren into two functions, one which assumes/requires the lock is already held, and one which acquires the lock. We don't have the owning task in this case, but we can either get it from the current task, or by looking at the parent of the child task we're working on.
rdar://147172991
`CooperativeExecutor` should fall back to heap allocations if the task
allocator isn't available when it's enqueuing delayed jobs.
Also, remove the reference to `DispatchGlobalExecutor` from the
custom executor test.
rdar://141348916
This adds conformances for C++ string types (`std::string`, `std::u16string`, `std::u32string`) to `Swift.ExpressibleByStringInterpolation`.
These conformances currently implicitly use `DefaultStringInterpolation`. In the future we can provide more performant interpolation mechanisms for C++ strings specifically that avoid the extra conversion between Swift String and C++ string types.
rdar://147249169
Fix a typo that caused us to not include the correct code for platforms
that use "singlethreaded" concurrency.
Also use `var` not `let` for the computed property in `PlatformExecutorFactory`.
rdar://141348916
* [Concurrency] Detect non-default impls of isIsolatingCurrentContext
* [Concurrency] No need for trailing info about isIsolating... in conformance
* Apply changes from review
* [Concurrency] Adjust task escalation APIs to SE accepted shapes
* adjust test a little bit
* Fix closure lifetime in withTaskPriorityEscalationHandler
* avoid bringing workaround func into abi by marking AEIC
```
stdlib/public/libexec/swift-backtrace/main.swift:590:15: warning: variable 'now' was never mutated; consider changing to 'let' constant
588 | let name = target!.name
589 | let pid = target!.pid
590 | var now = timespec(tv_sec: 0, tv_nsec: 0)
| `- warning: variable 'now' was never mutated; consider changing to 'let' constant
591 |
592 | let ext: String
```
Otherwise in certain cases, we will run into:
1588 | extension GlobalActor {
| | `- error: 'GlobalActor' is only available in macOS 10.15 or newer
| `- note: add @available attribute to enclosing extension
1589 | @available(SwiftStdlib 6.2, *)
1590 | @_silgen_name("_swift_task_isCurrentGlobalActor")
rdar://146848568
We need a store-release when putting a new page onto the metadata allocator so that other threads see the initialization. We also need to tell TSan about our memory barriers here, to avoid false positives in __swift_instantiateConcreteTypeFromMangledName when it reads from memory allocated here.
rdar://145778813