summaryrefslogtreecommitdiffstats
path: root/runtime/atomic.h
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-08-12 11:48:34 -0700
committerDan Albert <danalbert@google.com>2014-08-12 13:37:26 -0700
commit6a3f8d93ddf09b5f6667820089e488958cba8361 (patch)
tree0c20bb42a62b74e2bb647bf9a873be4b1fe81254 /runtime/atomic.h
parent6814d7b68ee13ec1a13ace669b025aa080d8b53e (diff)
downloadart-6a3f8d93ddf09b5f6667820089e488958cba8361.tar.gz
art-6a3f8d93ddf09b5f6667820089e488958cba8361.tar.bz2
art-6a3f8d93ddf09b5f6667820089e488958cba8361.zip
Initialize art::Atomic's value to 0.
art::Mutex and art::ConditionVariable were DCHECKing that the value was zero on entering the constructor without ever initializing the value. Since 0 is a sensible default, make it the default for art::Atomic rather than initializing for each use. Bug: 16301104 Change-Id: I9c98b82c80670b7a6c53d46a08236bbed6a64f8f
Diffstat (limited to 'runtime/atomic.h')
-rw-r--r--runtime/atomic.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/atomic.h b/runtime/atomic.h
index 5ddafb4b89..868f32cda4 100644
--- a/runtime/atomic.h
+++ b/runtime/atomic.h
@@ -256,7 +256,7 @@ class QuasiAtomic {
template<typename T>
class Atomic : public std::atomic<T> {
public:
- Atomic<T>() : std::atomic<T>() { }
+ Atomic<T>() : std::atomic<T>(0) { }
explicit Atomic<T>(T value) : std::atomic<T>(value) { }