Skip to content

Commit

Permalink
Fix the failure memory order argument to atomic_compare_exchange_stro…
Browse files Browse the repository at this point in the history
…ng_explicit

The failure memory order cannot be release or acq_rel. Clang since llvm/llvm-project@fed5644 diagnoses an invalid argument.
  • Loading branch information
AreaZR authored and vit9696 committed May 6, 2024
1 parent fd94078 commit a7fc69b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lilu/Headers/kern_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ class ThreadLocal {
for (size_t i = 0; ptr == nullptr && i < N; i++) {
thread_t nullThread = nullptr;
if (atomic_compare_exchange_strong_explicit(&threads[i], &nullThread, currThread,
memory_order_acq_rel, memory_order_acq_rel))
memory_order_acq_rel, memory_order_acquire))
ptr = &values[i];
}

Expand Down

0 comments on commit a7fc69b

Please sign in to comment.