summaryrefslogtreecommitdiff
path: root/runtime/base/mutex.h
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2013-12-20 16:13:02 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2013-12-20 16:13:02 +0000
commitac79f4dcaa0402f5d102bbdb7da938faea372d2e (patch)
treeaa7abdc45e1d7f63551b60f2e6ca12b7d28088f8 /runtime/base/mutex.h
parent93055a258c3a81d1b3b8eb44c9c71cf73ceeb8f0 (diff)
parentb122a4bbed34ab22b4c1541ee25e5cf22f12a926 (diff)
Merge "Tidy up memory barriers."
Diffstat (limited to 'runtime/base/mutex.h')
-rw-r--r--runtime/base/mutex.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/base/mutex.h b/runtime/base/mutex.h
index b894c0a3fa..1c1dcaf43f 100644
--- a/runtime/base/mutex.h
+++ b/runtime/base/mutex.h
@@ -191,7 +191,7 @@ class LOCKABLE Mutex : public BaseMutex {
// Exclusive owner.
volatile uint64_t exclusive_owner_;
// Number of waiting contenders.
- volatile int32_t num_contenders_;
+ AtomicInteger num_contenders_;
#else
pthread_mutex_t mutex_;
#endif
@@ -304,7 +304,7 @@ class LOCKABLE ReaderWriterMutex : public BaseMutex {
// Pending readers.
volatile int32_t num_pending_readers_;
// Pending writers.
- volatile int32_t num_pending_writers_;
+ AtomicInteger num_pending_writers_;
#else
pthread_rwlock_t rwlock_;
#endif
@@ -339,7 +339,7 @@ class ConditionVariable {
// their Mutex and another thread takes it and signals, the waiting thread observes that sequence_
// changed and doesn't enter the wait. Modified while holding guard_, but is read by futex wait
// without guard_ held.
- volatile int32_t sequence_;
+ AtomicInteger sequence_;
// Number of threads that have come into to wait, not the length of the waiters on the futex as
// waiters may have been requeued onto guard_. Guarded by guard_.
volatile int32_t num_waiters_;