Commit Graph

19 Commits

Author SHA1 Message Date
John McCall
a86b76a3e9 Use @isolated(any) function types for task functions.
The biggest annoyance here is having to clone all of the task creation
functions for Embedded Swift because it can't use `any Actor` right now.
2024-03-15 14:40:54 -04:00
Konrad `ktoso` Malawski
ef80d778dc [Concurrency] Fix the missing builtin guards for DiscardingTaskGroup (#70837) 2024-01-10 22:55:38 -08:00
Yuta Saito
7cccbcc84f [DiscardingTG] Remove reabstraction thunk for () -> Void to () -> T (#70537)
Concurrency runtime expects discarding task operation entrypoint
function not to have result type, but the current SILGen
implementation generates reabstraction thunk to convert `() -> Void`
to `() -> T` for the operation function.

Since the `T` is always `Void` for DiscardingTG, the mismatch of result
type expectation does not cause any problem on most platforms, but the
signature mismatch causes a problem on WebAssembly.

This patch introduces new builtin operations for creating discarding
task, which always takes `() -> Void` as the operation function type.
2024-01-10 07:17:15 +09:00
Alex Martini
e8d86e879e Minor adjustments for Apple style. 2023-09-27 13:31:17 -07:00
Alex Martini
ecdac2e5ae Remove stray whitespace at end of line. 2023-09-27 13:29:54 -07:00
Konrad `ktoso` Malawski
62ffc9f025 Fix cut off sentence and correct Throwing discarding task group docs
We cut off a sentence, this corrects that issue.

resolves rdar://115519046
2023-09-27 12:48:34 +09:00
Konrad `ktoso` Malawski
6bfef94c9e [docs][Concurrency] Include required parameter in group docs
[docs][Concurrency] Fix typo in method signature in code snippets of groups
2023-06-30 12:17:57 +09:00
Konrad `ktoso` Malawski
cad608eb81 [Discarding] Don't leak retained "first error" task when retaining it 2023-05-24 18:03:28 +02:00
Evan Wilde
08c4646a0a Merge pull request #65719 from etcwilde/ewilde/discarding-task-group-availability
Fix DiscardingTaskGroup availability
2023-05-07 18:15:02 -07:00
Evan Wilde
c6f551c683 Fix discarding task-group availability
Discarding task groups aren't available in the 5.8-aligned OS's,
resulting in a loader error at launch if you try to use them.

Bumping the availability attributes to 5.9 on everything in
DiscardingTaskGroup.swift
2023-05-05 15:01:43 -07:00
Konrad `ktoso` Malawski
97d2f4fd36 Fix pointer auth issues for discarding task group operation pointer (#65220) 2023-04-18 12:51:45 +09:00
Konrad `ktoso` Malawski
b666fc672e [Executors] Remote distributed actors get "crash on enqueue" default executor (#64969) 2023-04-10 19:12:03 +09:00
Konrad `ktoso` Malawski
be4caa5b93 [Docs][Concurrency] Fix documentation about cancellation, copy docs to a few methods (#63960) 2023-02-28 17:32:15 +09:00
Konrad `ktoso` Malawski
99fb37f678 [Concurrency] Fix too optimistic TaskGroup bail-out-when-empty, (#63016)
* [Concurrency] Fix too optimistic bail-out-when-empty, discarding group
may need to emit an error out of such waitAll attempt, if a previous
error was already stored.

* [Concurrency] DiscardingTG error thrown from body always wins

* Offering body error must be done while holding lock

* Must not modify waitingTask context outside lock

* wip on trying to fix by changing the offer

* fix bug in resuming tasks in offer/resume task in discarding group

* Fix #63147 waitForAll impl in ThrowingTaskGroup, used to not wait enough

rdar://104507347

* done

* debug

* explicitly declare virtual destructors

* detach child task after filling result; dont mutate context outside of lock

* Add pending count overflow protection to TaskGroup

* unlock async_taskgroup_void_neverConsumingTasks again rdar://104332560

* missing include on windows for error reporting

* fix ARM_ARCH_7K workaround snippet
2023-01-27 19:00:26 +09:00
Doug Gregor
9e76023546 Add BuiltinCreateTaskGroupWithFlags feature and use it to guard the builtin 2023-01-11 13:47:28 -08:00
Konrad `ktoso` Malawski
6f38910058 DiscardingTaskGroup now shares some implementation with "Accumulating" TaskGroup 2023-01-09 11:35:04 +09:00
Konrad `ktoso` Malawski
e37b998c56 implement simple rethrowing logic, however body throw always wins 2023-01-05 21:42:20 +09:00
Konrad `ktoso` Malawski
60ee652695 more docs 2023-01-05 16:19:06 +09:00
Konrad `ktoso` Malawski
7ac5b407a6 move to DiscardingTaskGroup 2023-01-05 16:19:05 +09:00