mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-24 12:34:31 +00:00
sync: Condvar: Use compare_exchange_weak
This allows the compiler to generate more efficient assembly for arm. It also maintains consistency for the whole file since we were already using compare_exchange_weak in some places and not others. BUG=none TEST=`FEATURES=test emerge-kukui-arc-r cros_async`. Also copy the unit test binary onto the device and run in a loop to see that there are no failures. Change-Id: Ia8c942c419ac2989a5653875d78c48003fb757d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2805754 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Chirantan Ekbote <chirantan@chromium.org>
This commit is contained in:
parent
19353d3e68
commit
3c45e3f7f7
1 changed files with 6 additions and 6 deletions
|
@ -163,11 +163,11 @@ impl Condvar {
|
|||
while (oldstate & SPINLOCK) != 0
|
||||
|| self
|
||||
.state
|
||||
.compare_exchange(
|
||||
.compare_exchange_weak(
|
||||
oldstate,
|
||||
oldstate | SPINLOCK | HAS_WAITERS,
|
||||
Ordering::Acquire,
|
||||
Ordering::Acquire,
|
||||
Ordering::Relaxed,
|
||||
)
|
||||
.is_err()
|
||||
{
|
||||
|
@ -215,11 +215,11 @@ impl Condvar {
|
|||
while (oldstate & SPINLOCK) != 0
|
||||
|| self
|
||||
.state
|
||||
.compare_exchange(
|
||||
.compare_exchange_weak(
|
||||
oldstate,
|
||||
oldstate | SPINLOCK,
|
||||
Ordering::Acquire,
|
||||
Ordering::Acquire,
|
||||
Ordering::Relaxed,
|
||||
)
|
||||
.is_err()
|
||||
{
|
||||
|
@ -273,11 +273,11 @@ impl Condvar {
|
|||
while (oldstate & SPINLOCK) != 0
|
||||
|| self
|
||||
.state
|
||||
.compare_exchange(
|
||||
.compare_exchange_weak(
|
||||
oldstate,
|
||||
oldstate | SPINLOCK,
|
||||
Ordering::Acquire,
|
||||
Ordering::Acquire,
|
||||
Ordering::Relaxed,
|
||||
)
|
||||
.is_err()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue