diff options
author | Ian Rogers <irogers@google.com> | 2014-04-17 16:08:07 -0700 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-04-17 16:08:07 -0700 |
commit | 5c597c6d3d6cfe0f9a89d35339c310d5a3395105 (patch) | |
tree | 8fbbc961d64b8d01253a86251e712c76dcab5f3e /runtime/monitor.h | |
parent | 94e8a97310af35cb0bae309e796b554cdb586ca5 (diff) | |
download | art-5c597c6d3d6cfe0f9a89d35339c310d5a3395105.tar.gz art-5c597c6d3d6cfe0f9a89d35339c310d5a3395105.tar.bz2 art-5c597c6d3d6cfe0f9a89d35339c310d5a3395105.zip |
Comment disallow new monitors.
Change-Id: Ie50424c73be051f9856ef9e86bdbf83fa76bbc48
Diffstat (limited to 'runtime/monitor.h')
-rw-r--r-- | runtime/monitor.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/monitor.h b/runtime/monitor.h index c459278269..0b80892ba9 100644 --- a/runtime/monitor.h +++ b/runtime/monitor.h @@ -231,6 +231,10 @@ class MonitorList { EXCLUSIVE_LOCKS_REQUIRED(Locks::mutator_lock_); private: + // During sweeping we may free an object and on a separate thread have an object created using + // the newly freed memory. That object may then have its lock-word inflated and a monitor created. + // If we allow new monitor registration during sweeping this monitor may be incorrectly freed as + // the object wasn't marked when sweeping began. bool allow_new_monitors_ GUARDED_BY(monitor_list_lock_); Mutex monitor_list_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER; ConditionVariable monitor_add_condition_ GUARDED_BY(monitor_list_lock_); |