Skip to content

Commit c0fd27f

Browse files
committed
[Concurrency] Minor cleanups to futures.
1 parent 7f3db7f commit c0fd27f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

include/swift/ABI/Task.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,16 +364,17 @@ class AsyncTask : public HeapObject, public Job {
364364
/// executor.
365365
void completeFuture(AsyncContext *context, ExecutorRef executor);
366366

367+
static bool classof(const Job *job) {
368+
return job->isAsyncTask();
369+
}
370+
371+
private:
367372
/// Access the next waiting task, which establishes a singly linked list of
368373
/// tasks that are waiting on a future.
369374
AsyncTask *&getNextWaitingTask() {
370375
return reinterpret_cast<AsyncTask *&>(
371376
SchedulerPrivate[NextWaitingTaskIndex]);
372377
}
373-
374-
static bool classof(const Job *job) {
375-
return job->isAsyncTask();
376-
}
377378
};
378379

379380
// The compiler will eventually assume these.

stdlib/public/Concurrency/Task.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void AsyncTask::completeFuture(AsyncContext *context, ExecutorRef executor) {
9797
newQueueHead, std::memory_order_acquire);
9898
assert(queueHead.getStatus() == Status::Executing);
9999

100-
// Notify every
100+
// Schedule every waiting task on the executor.
101101
auto waitingTask = queueHead.getTask();
102102
while (waitingTask) {
103103
// Find the next waiting task.

0 commit comments

Comments
 (0)