Skip to content

Commit 6cc65c5

Browse files
authored
Concurrency: Use "prioritized" spelling (NFC) (#80475)
These changes all reflect the the name `DefaultActorImplFooter::prioritizedJobs`. See also #70910 (comment).
1 parent a5c561f commit 6cc65c5

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

stdlib/public/Concurrency/Actor.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,8 +1167,8 @@ class alignas(sizeof(void *) * 2) ActiveActorStatus {
11671167
#endif
11681168
}
11691169

1170-
Job *getFirstUnprioritisedJob() const { return FirstJob; }
1171-
ActiveActorStatus withFirstUnprioritisedJob(Job *firstJob) const {
1170+
Job *getFirstUnprioritizedJob() const { return FirstJob; }
1171+
ActiveActorStatus withFirstUnprioritizedJob(Job *firstJob) const {
11721172
#if SWIFT_CONCURRENCY_ENABLE_PRIORITY_ESCALATION
11731173
return ActiveActorStatus(Flags, DrainLock, firstJob);
11741174
#else
@@ -1213,7 +1213,7 @@ class alignas(sizeof(void *) * 2) ActiveActorStatus {
12131213
break;
12141214
}
12151215
concurrency::trace::actor_state_changed(
1216-
actor, getFirstUnprioritisedJob(), traceState, distributedActorIsRemote,
1216+
actor, getFirstUnprioritizedJob(), traceState, distributedActorIsRemote,
12171217
isMaxPriorityEscalated(), static_cast<uint8_t>(getMaxPriority()));
12181218
}
12191219
};
@@ -1397,7 +1397,7 @@ class DefaultActorImpl
13971397
/// new priority
13981398
void enqueueStealer(Job *job, JobPriority priority);
13991399

1400-
/// Dequeues one job from `prioritisedJobs`.
1400+
/// Dequeues one job from `prioritizedJobs`.
14011401
/// The calling thread must be holding the actor lock while calling this
14021402
Job *drainOne();
14031403

@@ -1586,9 +1586,9 @@ void DefaultActorImpl::enqueue(Job *job, JobPriority priority) {
15861586
auto newState = oldState;
15871587

15881588
// Link this into the queue in the atomic state
1589-
Job *currentHead = oldState.getFirstUnprioritisedJob();
1589+
Job *currentHead = oldState.getFirstUnprioritizedJob();
15901590
setNextJob(job, currentHead);
1591-
newState = newState.withFirstUnprioritisedJob(job);
1591+
newState = newState.withFirstUnprioritizedJob(job);
15921592

15931593
if (oldState.isIdle()) {
15941594
// Schedule the actor
@@ -1769,13 +1769,13 @@ void DefaultActorImpl::processIncomingQueue() {
17691769
while (true) {
17701770
// If there aren't any new jobs in the incoming queue, we can return
17711771
// immediately without updating the status.
1772-
if (!oldState.getFirstUnprioritisedJob()) {
1772+
if (!oldState.getFirstUnprioritizedJob()) {
17731773
return;
17741774
}
17751775
assert(oldState.isAnyRunning());
17761776

17771777
auto newState = oldState;
1778-
newState = newState.withFirstUnprioritisedJob(nullptr);
1778+
newState = newState.withFirstUnprioritizedJob(nullptr);
17791779

17801780
if (_status().compare_exchange_weak(
17811781
oldState, newState,
@@ -1788,7 +1788,7 @@ void DefaultActorImpl::processIncomingQueue() {
17881788
}
17891789
}
17901790

1791-
handleUnprioritizedJobs(oldState.getFirstUnprioritisedJob());
1791+
handleUnprioritizedJobs(oldState.getFirstUnprioritizedJob());
17921792
}
17931793

17941794
// Called with actor lock held on current thread
@@ -1956,7 +1956,7 @@ void DefaultActorImpl::destroy() {
19561956
// Tasks on an actor are supposed to keep the actor alive until they start
19571957
// running and we can only get here if ref count of the object = 0 which means
19581958
// there should be no more tasks enqueued on the actor.
1959-
assert(!oldState.getFirstUnprioritisedJob() && "actor has queued jobs at destruction");
1959+
assert(!oldState.getFirstUnprioritizedJob() && "actor has queued jobs at destruction");
19601960

19611961
if (oldState.isIdle()) {
19621962
assert(prioritizedJobs.empty() && "actor has queued jobs at destruction");
@@ -2064,7 +2064,7 @@ retry:;
20642064
}
20652065

20662066
assert(oldState.getMaxPriority() == JobPriority::Unspecified);
2067-
assert(!oldState.getFirstUnprioritisedJob());
2067+
assert(!oldState.getFirstUnprioritizedJob());
20682068
// We cannot assert here that prioritizedJobs is empty,
20692069
// because lock is not held yet. Raise a flag to assert after getting the lock.
20702070
assertNoJobs = true;
@@ -2083,7 +2083,7 @@ retry:;
20832083
// check for higher priority jobs that could have been scheduled in the
20842084
// meantime. And processing is more efficient when done in larger batches.
20852085
if (asDrainer) {
2086-
newState = newState.withFirstUnprioritisedJob(nullptr);
2086+
newState = newState.withFirstUnprioritizedJob(nullptr);
20872087
}
20882088

20892089
// This needs an acquire since we are taking a lock
@@ -2096,7 +2096,7 @@ retry:;
20962096
}
20972097
traceActorStateTransition(this, oldState, newState, distributedActorIsRemote);
20982098
if (asDrainer) {
2099-
handleUnprioritizedJobs(oldState.getFirstUnprioritisedJob());
2099+
handleUnprioritizedJobs(oldState.getFirstUnprioritizedJob());
21002100
}
21012101
return true;
21022102
}
@@ -2147,7 +2147,7 @@ bool DefaultActorImpl::unlock(bool forceUnlock)
21472147

21482148
auto newState = oldState;
21492149
// Lock is still held at this point, so it is safe to access prioritizedJobs
2150-
if (!prioritizedJobs.empty() || oldState.getFirstUnprioritisedJob()) {
2150+
if (!prioritizedJobs.empty() || oldState.getFirstUnprioritizedJob()) {
21512151
// There is work left to do, don't unlock the actor
21522152
if (!forceUnlock) {
21532153
SWIFT_TASK_DEBUG_LOG("Unlock-ing actor %p failed", this);

0 commit comments

Comments
 (0)