wutstdc++: Use OSSwapAtomic where compare isn't necessary

This commit is contained in:
GaryOderNichts
2022-08-02 03:45:44 +02:00
committed by fincs
parent 4b81e19867
commit e81c3a159f

View File

@@ -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,