commit | 2e65afecba6877eaffa6bda825ae156e6c682fe5 | [log] [tgz] |
---|---|---|
author | Nick Desaulniers <ndesaulniers@google.com> | Tue Nov 19 09:27:06 2024 -0800 |
committer | Nick Desaulniers <ndesaulniers@google.com> | Tue Nov 19 09:40:44 2024 -0800 |
tree | ed9e8fb0aa2365a5913acc5c1b68ee00afd05b6c | |
parent | 4f9800aaebd15b53c1443fc8e2d46d864cc39537 [diff] [blame] |
bionic: libc: avoid -Wdeprecated-declarations via std::atomic_init std::atomic_init is deprecated in C++20, and is slated for removal in C++26. Replace the usage of std::atomic_init with std::atomic_store_explicit with std::memory_ordering_relaxed. Link: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0883r2.pdf Link: https://github.com/llvm/llvm-project/commit/56aac567acfd696f54163e33d8df02dc2ad3a72e Test: mmma bionic Change-Id: Idf42aea193cfacf8dd7f8528560a396c6064468c
diff --git a/libc/bionic/posix_timers.cpp b/libc/bionic/posix_timers.cpp index 65749a4..9516059 100644 --- a/libc/bionic/posix_timers.cpp +++ b/libc/bionic/posix_timers.cpp
@@ -141,7 +141,7 @@ // Otherwise, this must be SIGEV_THREAD timer... timer->callback = evp->sigev_notify_function; timer->callback_argument = evp->sigev_value; - atomic_init(&timer->deleted, false); + atomic_store_explicit(&timer->deleted, false, memory_order_relaxed); // Check arguments that the kernel doesn't care about but we do. if (timer->callback == nullptr) {