From e81c3a159f5b79c0451eb0a7f5ae43affc739462 Mon Sep 17 00:00:00 2001 From: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com> Date: Tue, 2 Aug 2022 03:45:44 +0200 Subject: [PATCH] wutstdc++: Use OSSwapAtomic where compare isn't necessary --- libraries/wutstdc++/wut_gthread_once.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libraries/wutstdc++/wut_gthread_once.cpp b/libraries/wutstdc++/wut_gthread_once.cpp index 5e7a03c5..52a2f4eb 100644 --- a/libraries/wutstdc++/wut_gthread_once.cpp +++ b/libraries/wutstdc++/wut_gthread_once.cpp @@ -11,9 +11,8 @@ __wut_once(__wut_once_t *once, __WUT_ONCE_VALUE_STARTED, &value)) { func(); - OSCompareAndSwapAtomic(once, - __WUT_ONCE_VALUE_STARTED, - __WUT_ONCE_VALUE_DONE); + OSSwapAtomic(once, + __WUT_ONCE_VALUE_DONE); } else if (value != __WUT_ONCE_VALUE_DONE) { while (!OSCompareAndSwapAtomic(once, __WUT_ONCE_VALUE_DONE,