Skip to content

Commit 6beb11e

Browse files
committed
Rename flagAsEnqueuedOnExecutor to flagAsAndEnqueueOnExecutor to reflect
what it actually does. Radar-Id: rdar://problem/88600541
1 parent 98a8bdb commit 6beb11e

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

include/swift/ABI/Task.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,9 @@ class AsyncTask : public Job {
317317
/// Flag that this task is now suspended.
318318
void flagAsSuspended();
319319

320-
/// Flag that the task is to be enqueued on the provided executor
321-
void flagAsEnqueuedOnExecutor(ExecutorRef newExecutor);
320+
/// Flag that the task is to be enqueued on the provided executor and actually
321+
/// enqueue it
322+
void flagAsAndEnqueueOnExecutor(ExecutorRef newExecutor);
322323

323324
/// Flag that this task is now completed. This normally does not do anything
324325
/// but can be used to locally insert logging.

stdlib/public/Concurrency/Actor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1618,7 +1618,7 @@ static void swift_task_switchImpl(SWIFT_ASYNC_CONTEXT AsyncContext *resumeContex
16181618
SWIFT_TASK_DEBUG_LOG("switch failed, task %p enqueued on executor %p", task,
16191619
newExecutor.getIdentity());
16201620

1621-
task->flagAsEnqueuedOnExecutor(newExecutor);
1621+
task->flagAsAndEnqueueOnExecutor(newExecutor);
16221622
_swift_task_clearCurrent();
16231623
}
16241624

stdlib/public/Concurrency/Task.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ void AsyncTask::completeFuture(AsyncContext *context) {
234234

235235
// Enqueue the waiter on the global executor.
236236
// TODO: allow waiters to fill in a suggested executor
237-
waitingTask->flagAsEnqueuedOnExecutor(ExecutorRef::generic());
237+
waitingTask->flagAsAndEnqueueOnExecutor(ExecutorRef::generic());
238238

239239
// Move to the next task.
240240
waitingTask = nextWaitingTask;
@@ -847,7 +847,7 @@ static AsyncTaskAndContext swift_task_create_commonImpl(
847847
// If we're supposed to enqueue the task, do so now.
848848
if (taskCreateFlags.enqueueJob()) {
849849
swift_retain(task);
850-
task->flagAsEnqueuedOnExecutor(executor);
850+
task->flagAsAndEnqueueOnExecutor(executor);
851851
}
852852

853853
return {task, initialContext};
@@ -1020,7 +1020,7 @@ SWIFT_CC(swift)
10201020
static void
10211021
swift_task_enqueueTaskOnExecutorImpl(AsyncTask *task, ExecutorRef executor)
10221022
{
1023-
task->flagAsEnqueuedOnExecutor(executor);
1023+
task->flagAsAndEnqueueOnExecutor(executor);
10241024
}
10251025

10261026
SWIFT_CC(swift)
@@ -1151,7 +1151,7 @@ static void resumeTaskAfterContinuation(AsyncTask *task,
11511151
// to make a stronger best-effort attempt to catch racing attempts to
11521152
// resume the continuation?
11531153

1154-
task->flagAsEnqueuedOnExecutor(context->ResumeToExecutor);
1154+
task->flagAsAndEnqueueOnExecutor(context->ResumeToExecutor);
11551155
}
11561156

11571157
SWIFT_CC(swift)

stdlib/public/Concurrency/TaskGroup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ void TaskGroupImpl::offer(AsyncTask *completedTask, AsyncContext *context) {
622622
_swift_tsan_acquire(static_cast<Job *>(waitingTask));
623623

624624
// TODO: allow the caller to suggest an executor
625-
waitingTask->flagAsEnqueuedOnExecutor(ExecutorRef::generic());
625+
waitingTask->flagAsAndEnqueueOnExecutor(ExecutorRef::generic());
626626
return;
627627
} // else, try again
628628
}

stdlib/public/Concurrency/TaskPrivate.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,9 +697,9 @@ retry:;
697697
/// original enqueueing thread.
698698
///
699699
/// rdar://88366470 (Direct handoff behaviour when tasks switch executors)
700-
inline void AsyncTask::flagAsEnqueuedOnExecutor(ExecutorRef newExecutor) {
700+
inline void AsyncTask::flagAsAndEnqueueOnExecutor(ExecutorRef newExecutor) {
701701

702-
SWIFT_TASK_DEBUG_LOG("%p->flagAsEnqueuedOnExecutor()", this);
702+
SWIFT_TASK_DEBUG_LOG("%p->flagAsAndEnqueueOnExecutor()", this);
703703
auto oldStatus = _private()._status().load(std::memory_order_relaxed);
704704
auto newStatus = oldStatus;
705705

0 commit comments

Comments
 (0)