Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Concurrency] TaskExecutor ownership fixes #74000

Merged
merged 10 commits into from
Jun 14, 2024
Prev Previous commit
[Embedded] Owned TaskExecutor is not available in Embeddedl fix runtime
This resolves linking issues on embedded platforms
  • Loading branch information
ktoso committed Jun 14, 2024
commit 6962c7e3d9af9e49987058461f9d1e9f918d70f8
4 changes: 4 additions & 0 deletions stdlib/public/Concurrency/Task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,10 +693,14 @@ swift_task_create_commonImpl(size_t rawTaskCreateFlags,
break;

case TaskOptionRecordKind::InitialTaskExecutorOwned:
#if SWIFT_CONCURRENCY_EMBEDDED
swift_unreachable("owned TaskExecutor cannot be used in embedded Swift");
#else
taskExecutor = cast<InitialTaskExecutorOwnedPreferenceTaskOptionRecord>(option)
->getExecutorRefFromUnownedTaskExecutor();
taskExecutorIsOwned = true;
jobFlags.task_setHasInitialTaskExecutorPreference(true);
#endif
break;

case TaskOptionRecordKind::TaskGroup:
Expand Down