@@ -394,14 +394,14 @@ class TaskGroupImpl: public TaskGroupTaskStatusRecord {
394
394
// /
395
395
// / This is used to atomically perform a waiting task completion.
396
396
bool statusCompletePendingReadyWaiting (GroupStatus &old) {
397
- return status.compare_exchange_weak (
397
+ return status.compare_exchange_strong (
398
398
old.status , old.completingPendingReadyWaiting ().status ,
399
399
/* success*/ std::memory_order_relaxed,
400
400
/* failure*/ std::memory_order_relaxed);
401
401
}
402
402
403
403
bool statusCompletePendingReady (GroupStatus &old) {
404
- return status.compare_exchange_weak (
404
+ return status.compare_exchange_strong (
405
405
old.status , old.completingPendingReady ().status ,
406
406
/* success*/ std::memory_order_relaxed,
407
407
/* failure*/ std::memory_order_relaxed);
@@ -588,7 +588,7 @@ void TaskGroupImpl::offer(AsyncTask *completedTask, AsyncContext *context) {
588
588
assert (assumed.pendingTasks () && " offered to group with no pending tasks!" );
589
589
// We are the "first" completed task to arrive,
590
590
// and since there is a task waiting we immediately claim and complete it.
591
- if (waitQueue.compare_exchange_weak (
591
+ if (waitQueue.compare_exchange_strong (
592
592
waitingTask, nullptr ,
593
593
/* success*/ std::memory_order_release,
594
594
/* failure*/ std::memory_order_acquire) &&
@@ -755,7 +755,7 @@ PollResult TaskGroupImpl::poll(AsyncTask *waitingTask) {
755
755
756
756
auto assumedStatus = assumed.status ;
757
757
auto newStatus = TaskGroupImpl::GroupStatus{assumedStatus};
758
- if (status.compare_exchange_weak (
758
+ if (status.compare_exchange_strong (
759
759
assumedStatus, newStatus.completingPendingReadyWaiting ().status ,
760
760
/* success*/ std::memory_order_relaxed,
761
761
/* failure*/ std::memory_order_acquire)) {
@@ -821,7 +821,7 @@ PollResult TaskGroupImpl::poll(AsyncTask *waitingTask) {
821
821
waitingTask->flagAsSuspended ();
822
822
}
823
823
// Put the waiting task at the beginning of the wait queue.
824
- if (waitQueue.compare_exchange_weak (
824
+ if (waitQueue.compare_exchange_strong (
825
825
waitHead, waitingTask,
826
826
/* success*/ std::memory_order_release,
827
827
/* failure*/ std::memory_order_acquire)) {
0 commit comments