@@ -396,14 +396,14 @@ class TaskGroupImpl: public TaskGroupTaskStatusRecord {
396396 // /
397397 // / This is used to atomically perform a waiting task completion.
398398 bool statusCompletePendingReadyWaiting (GroupStatus &old) {
399- return status.compare_exchange_weak (
399+ return status.compare_exchange_strong (
400400 old.status , old.completingPendingReadyWaiting ().status ,
401401 /* success*/ std::memory_order_relaxed,
402402 /* failure*/ std::memory_order_relaxed);
403403 }
404404
405405 bool statusCompletePendingReady (GroupStatus &old) {
406- return status.compare_exchange_weak (
406+ return status.compare_exchange_strong (
407407 old.status , old.completingPendingReady ().status ,
408408 /* success*/ std::memory_order_relaxed,
409409 /* failure*/ std::memory_order_relaxed);
@@ -590,7 +590,7 @@ void TaskGroupImpl::offer(AsyncTask *completedTask, AsyncContext *context) {
590590 assert (assumed.pendingTasks () && " offered to group with no pending tasks!" );
591591 // We are the "first" completed task to arrive,
592592 // 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 (
594594 waitingTask, nullptr ,
595595 /* success*/ std::memory_order_release,
596596 /* failure*/ std::memory_order_acquire) &&
@@ -757,7 +757,7 @@ PollResult TaskGroupImpl::poll(AsyncTask *waitingTask) {
757757
758758 auto assumedStatus = assumed.status ;
759759 auto newStatus = TaskGroupImpl::GroupStatus{assumedStatus};
760- if (status.compare_exchange_weak (
760+ if (status.compare_exchange_strong (
761761 assumedStatus, newStatus.completingPendingReadyWaiting ().status ,
762762 /* success*/ std::memory_order_relaxed,
763763 /* failure*/ std::memory_order_acquire)) {
@@ -823,7 +823,7 @@ PollResult TaskGroupImpl::poll(AsyncTask *waitingTask) {
823823 waitingTask->flagAsSuspended ();
824824 }
825825 // Put the waiting task at the beginning of the wait queue.
826- if (waitQueue.compare_exchange_weak (
826+ if (waitQueue.compare_exchange_strong (
827827 waitHead, waitingTask,
828828 /* success*/ std::memory_order_release,
829829 /* failure*/ std::memory_order_acquire)) {
0 commit comments