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