diff options
| author | 2013-11-19 18:00:50 -0800 | |
|---|---|---|
| committer | 2013-12-20 08:01:57 -0800 | |
| commit | b122a4bbed34ab22b4c1541ee25e5cf22f12a926 (patch) | |
| tree | 624f16271f4481a8fd5aa2f607385f490dc7b3ae /runtime/base/mutex.h | |
| parent | e40687d053b89c495b6fbeb7a766b01c9c7e039c (diff) | |
Tidy up memory barriers.
Change-Id: I937ea93e6df1835ecfe2d4bb7d84c24fe7fc097b
Diffstat (limited to 'runtime/base/mutex.h')
| -rw-r--r-- | runtime/base/mutex.h | 6 |
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_; |