diff options
author | 2024-09-19 13:29:47 +0100 | |
---|---|---|
committer | 2024-09-23 10:31:49 +0000 | |
commit | 91f44f6bfe830c5d35ea8045c308092ffc0c91d4 (patch) | |
tree | 87ff04768b62269ba01f9a19fea035eeb7598be5 /runtime/base/mutex.cc | |
parent | 56d62450fcd69434b94158a42f1a195bd7ee858b (diff) |
Update volatile variables to C++20
This gets rid of the -Wdeprecated-volatile warnings. More info in the
proposal: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1152r4.html
The bool ones weren't causing warnings but we might as well clean
them up in this CL too.
Bug: 368241186
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Change-Id: Iddb60c2fe600ef27f29c943b3b669171e7f9aed3
Diffstat (limited to 'runtime/base/mutex.cc')
-rw-r--r-- | runtime/base/mutex.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc index 831c53599d..0abe9667f8 100644 --- a/runtime/base/mutex.cc +++ b/runtime/base/mutex.cc @@ -109,7 +109,7 @@ static void BackOff(uint32_t i) { volatile uint32_t x = 0; const uint32_t spin_count = 10 * i; for (uint32_t spin = 0; spin < spin_count; ++spin) { - ++x; // Volatile; hence should not be optimized away. + x = x + 1; // Volatile; hence should not be optimized away. } // TODO: Consider adding x86 PAUSE and/or ARM YIELD here. } else if (i <= kYieldMax) { |