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