Skip to content

[Concurrency] Fix build in actors as locks configuration #75004

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

Merged
merged 1 commit into from
Jul 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions stdlib/public/Concurrency/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,13 @@ static NonDefaultDistributedActorImpl *asImpl(NonDefaultDistributedActor *actor)
/******************** NEW DEFAULT ACTOR IMPLEMENTATION ***********************/
/*****************************************************************************/

TaskExecutorRef TaskExecutorRef::fromTaskExecutorPreference(Job *job) {
if (auto task = dyn_cast<AsyncTask>(job)) {
return task->getPreferredTaskExecutor();
}
return TaskExecutorRef::undefined();
}

#if !SWIFT_CONCURRENCY_ACTORS_AS_LOCKS

static void traceJobQueue(DefaultActorImpl *actor, Job *first) {
Expand Down Expand Up @@ -1320,13 +1327,6 @@ void DefaultActorImpl::scheduleActorProcessJob(
swift_task_enqueueGlobal(job);
}

TaskExecutorRef TaskExecutorRef::fromTaskExecutorPreference(Job *job) {
if (auto task = dyn_cast<AsyncTask>(job)) {
return task->getPreferredTaskExecutor();
}
return TaskExecutorRef::undefined();
}

void DefaultActorImpl::enqueue(Job *job, JobPriority priority) {
// We can do relaxed loads here, we are just using the current head in the
// atomic state and linking that into the new job we are inserting, we don't
Expand Down