swift
83430030 - [Concurrency] Fix task excutor handling of default actor isolation

Commit
1 year ago
[Concurrency] Fix task excutor handling of default actor isolation The task executor API did not properly account for taking the default actor locking into account when running code on it, we just took the job and ran it without checking with the serial executor at all, which resulted in potential concurrent executions inside the actor -- violating actor isolation. Here we change the TaskExecutor enqueue API to accept the "target" serial executor, which in practice will be either generic or a specific default actor, and coordinate with it when we perform a runSynchronously. The SE proposal needs to be amended to showcase this new API, however without this change we are introducing races so we must do this before the API is stable.
Author
Committer
Parents
Loading