@@ -184,7 +184,7 @@ static void waitForStatusRecordUnlock(AsyncTask *task,
184
184
// / If `forCancellation` is true, the cancelled bit will be set in the
185
185
// / state, and the lock will not be acquired if the task is already
186
186
// / cancelled or can be cancelled without the lock. If this occurs,
187
- // / `isCanceled ()` will be true for the return value.
187
+ // / `isCancelled ()` will be true for the return value.
188
188
static ActiveTaskStatus
189
189
acquireStatusRecordLock (AsyncTask *task,
190
190
Optional<StatusRecordLockRecord> &recordLockRecord,
@@ -204,7 +204,7 @@ acquireStatusRecordLock(AsyncTask *task,
204
204
// Cancellation should be idempotent: if the task has already
205
205
// been cancelled (or is being cancelled concurrently), there
206
206
// shouldn't be any need to do this work again.
207
- if (oldStatus.isCanceled () && forCancellation)
207
+ if (oldStatus.isCancelled () && forCancellation)
208
208
return oldStatus;
209
209
210
210
// If the old info says we're locked, wait for the lock to clear.
@@ -238,9 +238,9 @@ acquireStatusRecordLock(AsyncTask *task,
238
238
239
239
// Install the lock record as the active cancellation info, or
240
240
// restart if that fails.
241
- bool newIsCanceled = forCancellation || oldStatus.isCanceled ();
241
+ bool newIsCancelled = forCancellation || oldStatus.isCancelled ();
242
242
ActiveTaskStatus newStatus (&*recordLockRecord,
243
- /* cancelled*/ newIsCanceled ,
243
+ /* cancelled*/ newIsCancelled ,
244
244
/* locked*/ true );
245
245
if (task->Status .compare_exchange_weak (oldStatus, newStatus,
246
246
/* success*/ std::memory_order_release,
@@ -288,12 +288,12 @@ bool swift::swift_task_addStatusRecord(AsyncTask *task,
288
288
// We have to use a release on success to make the initialization of
289
289
// the new record visible to the cancelling thread.
290
290
ActiveTaskStatus newStatus (newRecord,
291
- oldStatus.isCanceled (),
291
+ oldStatus.isCancelled (),
292
292
/* locked*/ false );
293
293
if (task->Status .compare_exchange_weak (oldStatus, newStatus,
294
294
/* success*/ std::memory_order_release,
295
295
/* failure*/ std::memory_order_relaxed))
296
- return !oldStatus.isCanceled ();
296
+ return !oldStatus.isCancelled ();
297
297
}
298
298
}
299
299
@@ -305,14 +305,14 @@ bool swift::swift_task_tryAddStatusRecord(AsyncTask *task,
305
305
306
306
while (true ) {
307
307
// If the old info is already cancelled, do nothing.
308
- if (oldStatus.isCanceled ())
308
+ if (oldStatus.isCancelled ())
309
309
return false ;
310
310
311
311
// Wait for any active lock to be released.
312
312
if (oldStatus.isLocked ()) {
313
313
waitForStatusRecordUnlock (task, oldStatus);
314
314
315
- if (oldStatus.isCanceled ())
315
+ if (oldStatus.isCancelled ())
316
316
return false ;
317
317
}
318
318
@@ -345,12 +345,12 @@ bool swift::swift_task_removeStatusRecord(AsyncTask *task,
345
345
// If the record is the innermost record, try to just pop it off.
346
346
if (oldStatus.getInnermostRecord () == record) {
347
347
ActiveTaskStatus newStatus (record->getParent (),
348
- oldStatus.isCanceled (),
348
+ oldStatus.isCancelled (),
349
349
/* locked*/ false );
350
350
if (task->Status .compare_exchange_weak (oldStatus, newStatus,
351
351
/* success*/ std::memory_order_release,
352
352
/* failure*/ std::memory_order_relaxed))
353
- return !oldStatus.isCanceled ();
353
+ return !oldStatus.isCancelled ();
354
354
355
355
// Otherwise, restart.
356
356
continue ;
@@ -389,7 +389,7 @@ bool swift::swift_task_removeStatusRecord(AsyncTask *task,
389
389
// exactly what we want to restore.
390
390
releaseStatusRecordLock (task, oldStatus, recordLockRecord);
391
391
392
- return !oldStatus.isCanceled ();
392
+ return !oldStatus.isCancelled ();
393
393
}
394
394
395
395
/* *************************************************************************/
@@ -443,7 +443,7 @@ void swift::swift_task_cancel(AsyncTask *task) {
443
443
444
444
// If we were already cancelled or were able to cancel without acquiring
445
445
// the lock, there's nothing else to do.
446
- if (oldStatus.isCanceled ())
446
+ if (oldStatus.isCancelled ())
447
447
return ;
448
448
449
449
// Otherwise, we've installed the lock record and are now the
@@ -561,7 +561,7 @@ NearestTaskDeadline swift::swift_task_getNearestDeadline(AsyncTask *task) {
561
561
NearestTaskDeadline result;
562
562
563
563
// If it's already cancelled, we're done.
564
- if (oldStatus.isCanceled ()) {
564
+ if (oldStatus.isCancelled ()) {
565
565
result.ValueKind = NearestTaskDeadline::AlreadyCancelled;
566
566
return result;
567
567
}
0 commit comments