summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-07-16 01:08:37 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-07-16 01:08:37 +0000
commit03adf7a89a4e1e1e4108331c93b8d0ad203f4763 (patch)
tree88d328e3b2eb653b7417d1d640f0596f1a8cf16e
parente1b7bc90109efed0a10212150732867b3fbf27bb (diff)
parentd2f1b904b21727ebdaf308c2d366464a2470fea9 (diff)
downloadart-android11-d1-s6-release.tar.gz
Change-Id: I2e2566ed551146572a903c3c1e00b31677cf3e08
-rw-r--r--runtime/base/mutex.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc
index 0d1b162be7..0b8c781858 100644
--- a/runtime/base/mutex.cc
+++ b/runtime/base/mutex.cc
@@ -457,7 +457,8 @@ void Mutex::ExclusiveLock(Thread* self) {
SleepIfRuntimeDeleted(self);
// Retry until not held. In heavy contention situations we otherwise get redundant
// futex wakeups as a result of repeatedly decrementing and incrementing contenders.
- } while ((state_and_contenders_.load(std::memory_order_relaxed) & kHeldMask) != 0);
+ cur_state = state_and_contenders_.load(std::memory_order_relaxed);
+ } while ((cur_state & kHeldMask) != 0);
decrement_contenders();
}
}