diff options
author | 2015-08-04 15:19:41 -0700 | |
---|---|---|
committer | 2015-08-04 18:56:54 -0700 | |
commit | 90ef3db4bd1d4865f5f9cb95c8e7d9afb46994f9 (patch) | |
tree | 3c6f8989e0c6e027382a3c08d221ba97afd72291 /runtime/intern_table.h | |
parent | 1cf85515600d298a2c9e4de137c0926949205097 (diff) |
Address some comments and clean up
Change-Id: I538cf204f1c89d5fc81f8fc5e5800fcf1cf87359
Diffstat (limited to 'runtime/intern_table.h')
-rw-r--r-- | runtime/intern_table.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/runtime/intern_table.h b/runtime/intern_table.h index 0be66759ac..ae9f7a7acd 100644 --- a/runtime/intern_table.h +++ b/runtime/intern_table.h @@ -61,8 +61,10 @@ class InternTable { SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_); // Only used by image writer. Special version that may not cause thread suspension since the GC - // can not be running while we are doing image writing. - mirror::String* InternImageString(mirror::String* s) SHARED_REQUIRES(Locks::mutator_lock_); + // can not be running while we are doing image writing. Maybe be called while while holding a + // lock since there will not be thread suspension. + mirror::String* InternStrongImageString(mirror::String* s) + SHARED_REQUIRES(Locks::mutator_lock_); // Interns a potentially new string in the 'strong' table. May cause thread suspension. mirror::String* InternStrong(const char* utf8_data) SHARED_REQUIRES(Locks::mutator_lock_) @@ -184,7 +186,9 @@ class InternTable { UnorderedSet post_zygote_table_; }; - // Insert if non null, otherwise return null. + // Insert if non null, otherwise return null. Must be called holding the mutator lock. + // If holding_locks is true, then we may also hold other locks. If holding_locks is true, then we + // require GC is not running since it is not safe to wait while holding locks. mirror::String* Insert(mirror::String* s, bool is_strong, bool holding_locks) REQUIRES(!Locks::intern_table_lock_) SHARED_REQUIRES(Locks::mutator_lock_); |