summaryrefslogtreecommitdiff
path: root/runtime/gc/system_weak_test.cc
diff options
context:
space:
mode:
author Hiroshi Yamauchi <yamauchi@google.com> 2016-11-03 13:06:52 -0700
committer Hiroshi Yamauchi <yamauchi@google.com> 2016-11-09 18:14:08 -0800
commit3049324f4ef71b5d7a3de49bd77c75f07dbf8f3a (patch)
tree19e2d9d5e8476bf526dd5924ef05b1d727b75f8b /runtime/gc/system_weak_test.cc
parente7b46e22c7f4f6f503501b3b2ad99113289d142b (diff)
Make empty checkpoint work while weak ref access is disabled.
Fix a potential race on PushOntoMarkStack for CC by running an empty checkpoint (while weak ref access is disabled). Bug: 32508093 Bug: 12687968 Test: test-art-host with CC/CMS, libartd boot with N9, Ritz EAAC. Change-Id: I3749bb525e7734804307ee16262355f3fc730312
Diffstat (limited to 'runtime/gc/system_weak_test.cc')
-rw-r--r--runtime/gc/system_weak_test.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/runtime/gc/system_weak_test.cc b/runtime/gc/system_weak_test.cc
index af8a444903..9b601c0753 100644
--- a/runtime/gc/system_weak_test.cc
+++ b/runtime/gc/system_weak_test.cc
@@ -58,12 +58,14 @@ struct CountingSystemWeakHolder : public SystemWeakHolder {
disallow_count_++;
}
- void Broadcast() OVERRIDE
- REQUIRES_SHARED(Locks::mutator_lock_)
+ void Broadcast(bool broadcast_for_checkpoint) OVERRIDE
REQUIRES(!allow_disallow_lock_) {
- SystemWeakHolder::Broadcast();
+ SystemWeakHolder::Broadcast(broadcast_for_checkpoint);
- allow_count_++;
+ if (!broadcast_for_checkpoint) {
+ // Don't count the broadcasts for running checkpoints.
+ allow_count_++;
+ }
}
void Sweep(IsMarkedVisitor* visitor) OVERRIDE