mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Change the async ABI to not pass the active task and executor.
Most of the async runtime functions have been changed to not expect the task and executor to be passed in. When knowing the task and executor is necessary, there are runtime functions available to recover them. The biggest change I had to make to a runtime function signature was to swift_task_switch, which has been altered to expect to be passed the context and resumption function instead of requiring the caller to park the task. This has the pleasant consequence of allowing the implementation to very quickly turn around when it recognizes that the current executor is satisfactory. It does mean that on arm64e we have to sign the continuation function pointer as an argument and then potentially resign it when assigning into the task's resume slot. rdar://70546948
This commit is contained in:
@@ -114,11 +114,11 @@ public:
|
||||
|
||||
using JobInvokeFunction =
|
||||
SWIFT_CC(swiftasync)
|
||||
void (Job *, ExecutorRef);
|
||||
void (Job *);
|
||||
|
||||
using TaskContinuationFunction =
|
||||
SWIFT_CC(swiftasync)
|
||||
void (AsyncTask *, ExecutorRef, SWIFT_ASYNC_CONTEXT AsyncContext *);
|
||||
void (SWIFT_ASYNC_CONTEXT AsyncContext *);
|
||||
|
||||
template <class AsyncSignature>
|
||||
class AsyncFunctionPointer;
|
||||
|
||||
Reference in New Issue
Block a user