@@ -969,8 +969,7 @@ class DefaultActorImplHeader : public HeapObject {
969
969
// All the fields accessed under the actor's lock should be moved
970
970
// to the end of the default-actor reservation to minimize false sharing.
971
971
// The memory following the DefaultActorImpl object are the stored properties of
972
- // the actor, which are likely all isolated and therefore used only by the
973
- // current processing thread.
972
+ // the actor, which are all accessed only by the current processing thread.
974
973
class DefaultActorImplFooter {
975
974
protected:
976
975
#if !SWIFT_CONCURRENCY_ACTORS_AS_LOCKS
@@ -980,10 +979,11 @@ class DefaultActorImplFooter {
980
979
// stored inside ActiveActorStatus. This list contains jobs in the LIFO order
981
980
// regardless of their priorities.
982
981
//
983
- // After that processing thread collects them and adds to the
984
- // `prioritisedJobs` while holding the actor lock.
982
+ // When the processing thread sees new incoming jobs in
983
+ // ActiveActorStatus, it reverses them and inserts them into
984
+ // prioritizedJobs in the appropriate priority bucket.
985
985
//
986
- PriorityQueue prioritisedJobs ;
986
+ PriorityQueue prioritizedJobs ;
987
987
988
988
// As an optimisation, we handle unprioritized jobs when obtaining actor lock.
989
989
// This flag is used to skip `processIncomingQueue()` on the iteration of the
@@ -1056,7 +1056,7 @@ class DefaultActorImpl
1056
1056
new (&this ->drainLock ) Mutex ();
1057
1057
#else
1058
1058
_status ().store (ActiveActorStatus (), std::memory_order_relaxed);
1059
- new (&this ->prioritisedJobs ) PriorityQueue ();
1059
+ new (&this ->prioritizedJobs ) PriorityQueue ();
1060
1060
this ->shouldProcessIncomingQueue = true ;
1061
1061
#endif
1062
1062
SWIFT_TASK_DEBUG_LOG (" Creating default actor %p" , this );
@@ -1128,7 +1128,7 @@ class DefaultActorImpl
1128
1128
// / Called with actor lock held on current thread.
1129
1129
void processIncomingQueue ();
1130
1130
1131
- // / Processes claimed incoming jobs into `prioritisedJobs `.
1131
+ // / Processes claimed incoming jobs into `prioritizedJobs `.
1132
1132
// / Incoming jobs are of mixed priorities and in LIFO order.
1133
1133
// / Called with actor lock held on current thread.
1134
1134
void handleUnprioritizedJobs (Job *head);
@@ -1426,7 +1426,7 @@ void DefaultActorImpl::handleUnprioritizedJobs(Job *head) {
1426
1426
reversed = head;
1427
1427
head = next;
1428
1428
}
1429
- prioritisedJobs .enqueueContentsOf (reversed);
1429
+ prioritizedJobs .enqueueContentsOf (reversed);
1430
1430
shouldProcessIncomingQueue = false ;
1431
1431
}
1432
1432
@@ -1435,8 +1435,8 @@ Job *DefaultActorImpl::drainOne() {
1435
1435
SWIFT_TASK_DEBUG_LOG (" Draining one job from default actor %p" , this );
1436
1436
1437
1437
processIncomingQueue ();
1438
- traceJobQueue (this , prioritisedJobs .peek ());
1439
- auto firstJob = prioritisedJobs .dequeue ();
1438
+ traceJobQueue (this , prioritizedJobs .peek ());
1439
+ auto firstJob = prioritizedJobs .dequeue ();
1440
1440
if (!firstJob) {
1441
1441
SWIFT_TASK_DEBUG_LOG (" No jobs to drain on actor %p" , this );
1442
1442
} else {
@@ -1569,11 +1569,11 @@ void DefaultActorImpl::destroy() {
1569
1569
assert (!oldState.getFirstUnprioritisedJob () && " actor has queued jobs at destruction" );
1570
1570
1571
1571
if (oldState.isIdle ()) {
1572
- assert (prioritisedJobs .empty () && " actor has queued jobs at destruction" );
1572
+ assert (prioritizedJobs .empty () && " actor has queued jobs at destruction" );
1573
1573
return ;
1574
1574
}
1575
1575
assert (oldState.isRunning () && " actor scheduled but not running at destruction" );
1576
- // In running state we cannot safely access prioritisedJobs to assert that it is empty.
1576
+ // In running state we cannot safely access prioritizedJobs to assert that it is empty.
1577
1577
#endif
1578
1578
}
1579
1579
@@ -1667,7 +1667,7 @@ retry:;
1667
1667
1668
1668
assert (oldState.getMaxPriority () == JobPriority::Unspecified);
1669
1669
assert (!oldState.getFirstUnprioritisedJob ());
1670
- // We cannot assert here that prioritisedJobs is empty,
1670
+ // We cannot assert here that prioritizedJobs is empty,
1671
1671
// because lock is not held yet. Raise a flag to assert after getting the lock.
1672
1672
assertNoJobs = true ;
1673
1673
}
@@ -1687,7 +1687,7 @@ retry:;
1687
1687
std::memory_order_relaxed)) {
1688
1688
_swift_tsan_acquire (this );
1689
1689
if (assertNoJobs) {
1690
- assert (prioritisedJobs .empty ());
1690
+ assert (prioritizedJobs .empty ());
1691
1691
}
1692
1692
traceActorStateTransition (this , oldState, newState, distributedActorIsRemote);
1693
1693
handleUnprioritizedJobs (oldState.getFirstUnprioritisedJob ());
@@ -1738,8 +1738,8 @@ bool DefaultActorImpl::unlock(bool forceUnlock)
1738
1738
}
1739
1739
1740
1740
auto newState = oldState;
1741
- // Lock is still held at this point, so it is safe to access prioritisedJobs
1742
- if (!prioritisedJobs .empty () || oldState.getFirstUnprioritisedJob ()) {
1741
+ // Lock is still held at this point, so it is safe to access prioritizedJobs
1742
+ if (!prioritizedJobs .empty () || oldState.getFirstUnprioritisedJob ()) {
1743
1743
// There is work left to do, don't unlock the actor
1744
1744
if (!forceUnlock) {
1745
1745
SWIFT_TASK_DEBUG_LOG (" Unlock-ing actor %p failed" , this );
0 commit comments