@@ -83,7 +83,7 @@ class StatusRecordLockRecord :
83
83
// / Wait for a task's status record lock to be unlocked.
84
84
// /
85
85
// / When this function returns, `oldStatus` will have been updated
86
- // / to the last value read and `isLocked ()` will be false.
86
+ // / to the last value read and `isStatusRecordLocked ()` will be false.
87
87
// / Of course, another thread may still be concurrently trying
88
88
// / to acquire the record lock.
89
89
static void waitForStatusRecordUnlock (AsyncTask *task,
@@ -92,12 +92,12 @@ static void waitForStatusRecordUnlock(AsyncTask *task,
92
92
StatusRecordLockRecord::Waiter waiter (StatusRecordLockLock);
93
93
94
94
while (true ) {
95
- assert (oldStatus.isLocked ());
95
+ assert (oldStatus.isStatusRecordLocked ());
96
96
97
97
bool waited = waiter.tryReloadAndWait ([&]() -> StatusRecordLockRecord* {
98
98
// Check that oldStatus is still correct.
99
99
oldStatus = task->_private ().Status .load (std::memory_order_acquire);
100
- if (!oldStatus.isLocked ())
100
+ if (!oldStatus.isStatusRecordLocked ())
101
101
return nullptr ;
102
102
103
103
// The innermost entry should be a record lock record; wait
@@ -110,7 +110,7 @@ static void waitForStatusRecordUnlock(AsyncTask *task,
110
110
111
111
// Reload the status before trying to relock.
112
112
oldStatus = task->_private ().Status .load (std::memory_order_acquire);
113
- if (!oldStatus.isLocked ())
113
+ if (!oldStatus.isStatusRecordLocked ())
114
114
return ;
115
115
}
116
116
}
@@ -171,7 +171,7 @@ static bool withStatusRecordLock(AsyncTask *task,
171
171
return false ;
172
172
173
173
// If the old info says we're locked, wait for the lock to clear.
174
- if (status.isLocked ()) {
174
+ if (status.isStatusRecordLocked ()) {
175
175
waitForStatusRecordUnlock (task, status);
176
176
continue ;
177
177
}
@@ -231,7 +231,7 @@ static bool withStatusRecordLock(AsyncTask *task,
231
231
// task will see, we need to do so in some other way, probably via
232
232
// atomic objects in the task status records. Because of this, we can
233
233
// actually unpublish the lock with a relaxed store.
234
- assert (!status.isLocked ());
234
+ assert (!status.isStatusRecordLocked ());
235
235
status.traceStatusChanged (task);
236
236
task->_private ().Status .store (status,
237
237
/* success*/ std::memory_order_relaxed);
@@ -271,7 +271,7 @@ bool swift::addStatusRecord(
271
271
272
272
while (true ) {
273
273
// Wait for any active lock to be released.
274
- if (oldStatus.isLocked ())
274
+ if (oldStatus.isStatusRecordLocked ())
275
275
waitForStatusRecordUnlock (task, oldStatus);
276
276
277
277
// Reset the parent of the new record.
@@ -309,7 +309,7 @@ bool swift::removeStatusRecord(TaskStatusRecord *record) {
309
309
310
310
while (true ) {
311
311
// Wait for any active lock to be released.
312
- if (oldStatus.isLocked ())
312
+ if (oldStatus.isStatusRecordLocked ())
313
313
waitForStatusRecordUnlock (task, oldStatus);
314
314
315
315
// If the record is the innermost record, try to just pop it off.
@@ -653,9 +653,9 @@ static NearestTaskDeadline swift_task_getNearestDeadlineImpl(AsyncTask *task) {
653
653
654
654
// If it's locked, wait for the lock; we can't safely step through
655
655
// the RecordLockStatusRecord on a different thread.
656
- if (oldStatus.isLocked ()) {
656
+ if (oldStatus.isStatusRecordLocked ()) {
657
657
waitForStatusRecordUnlock (task, oldStatus);
658
- assert (!oldStatus.isLocked ());
658
+ assert (!oldStatus.isStatusRecordLocked ());
659
659
}
660
660
661
661
// Walk all the records looking for deadlines.
0 commit comments