diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-08-23 16:37:27 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-08-23 16:54:24 -0700 |
commit | bf99f77dda749e2b653e8c45259b1fb56e7bb012 (patch) | |
tree | 98addbb3533c745781bc26e4a55cbbdd6d6e97e7 /runtime/object_lock.h | |
parent | 762f0a5bdd238458bbb463a9565388f2047a98d4 (diff) | |
download | art-bf99f77dda749e2b653e8c45259b1fb56e7bb012.zip art-bf99f77dda749e2b653e8c45259b1fb56e7bb012.tar.gz art-bf99f77dda749e2b653e8c45259b1fb56e7bb012.tar.bz2 |
Clean up Handle usage.
Prefer using ConstHandle instead of Handle as function arguments
since you can't assign new references to ConstHandle which helps
prevent bugs.
Changed NullHandle to be a ConstHandle so that you can never modify
it to be a non null reference.
Change-Id: I81cb979f6f8d5b49e5614966a2caf28c3701dd4f
Diffstat (limited to 'runtime/object_lock.h')
-rw-r--r-- | runtime/object_lock.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/object_lock.h b/runtime/object_lock.h index acddc03..38690bc 100644 --- a/runtime/object_lock.h +++ b/runtime/object_lock.h @@ -28,7 +28,7 @@ class Thread; template <typename T> class ObjectLock { public: - ObjectLock(Thread* self, Handle<T> object) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); + ObjectLock(Thread* self, ConstHandle<T> object) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); ~ObjectLock() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); @@ -40,7 +40,7 @@ class ObjectLock { private: Thread* const self_; - Handle<T> const obj_; + ConstHandle<T> const obj_; DISALLOW_COPY_AND_ASSIGN(ObjectLock); }; |