Some fixes for the CC collector.
- Remove a DCHECK in DisableMarkingCheckpoint, which caused
occasional (false) failures.
- Check the thread-local GetWeakRefAccessEnabled in boxed lambdas weak
access.
- Add missing BroadcastForNewAllocationRecords and
BroadcastForNewWeakBoxedLambdas. The lack of the former caused
occasional deadlocks in the ddmc test.
- Remove the 'ensure system weaks disallowed' calls, which weren't
useful and dead.
Bug: 12687968
Change-Id: I33850c8d12e6e1a3aed1c2bb18eba263cbab76e8
diff --git a/runtime/monitor.cc b/runtime/monitor.cc
index da6ee25..95fcb67 100644
--- a/runtime/monitor.cc
+++ b/runtime/monitor.cc
@@ -1126,24 +1126,19 @@
}
void MonitorList::DisallowNewMonitors() {
+ CHECK(!kUseReadBarrier);
MutexLock mu(Thread::Current(), monitor_list_lock_);
allow_new_monitors_ = false;
}
void MonitorList::AllowNewMonitors() {
+ CHECK(!kUseReadBarrier);
Thread* self = Thread::Current();
MutexLock mu(self, monitor_list_lock_);
allow_new_monitors_ = true;
monitor_add_condition_.Broadcast(self);
}
-void MonitorList::EnsureNewMonitorsDisallowed() {
- // Lock and unlock once to ensure that no threads are still in the
- // middle of adding new monitors.
- MutexLock mu(Thread::Current(), monitor_list_lock_);
- CHECK(!allow_new_monitors_);
-}
-
void MonitorList::BroadcastForNewMonitors() {
CHECK(kUseReadBarrier);
Thread* self = Thread::Current();