Revert "Workaround bogus Thread Safety Analysis warning"
Alter the thread safety analysis attribute of ReaderWriterLock::AssertNotHeld
so that it accurately expresses "lock not held either exclusively or shared".
Re-enable Locks::mutator_lock_->AssertNotHeld runtime checks in heap.cc
and adbconnection.cc.
This reverts commit e11d50f23dc1256ad933d209f2db8f58138f02c0.
Bug: 71769596
Change-Id: I94488ad5f977b0de13a5141c54f67272a41f8b53
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index d2e1520..d68c171 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -2005,10 +2005,7 @@
count_requested_homogeneous_space_compaction_++;
// Store performed homogeneous space compaction at a new request arrival.
ScopedThreadStateChange tsc(self, kWaitingPerformingGc);
- // TODO: Clang prebuilt for r316199 produces bogus thread safety analysis warning for holding both
- // exclusive and shared lock in the same scope. Remove the assertion as a temporary workaround.
- // http://b/71769596
- // Locks::mutator_lock_->AssertNotHeld(self);
+ Locks::mutator_lock_->AssertNotHeld(self);
{
ScopedThreadStateChange tsc2(self, kWaitingForGcToComplete);
MutexLock mu(self, *gc_complete_lock_);
@@ -2511,10 +2508,7 @@
}
}
ScopedThreadStateChange tsc(self, kWaitingPerformingGc);
- // TODO: Clang prebuilt for r316199 produces bogus thread safety analysis warning for holding both
- // exclusive and shared lock in the same scope. Remove the assertion as a temporary workaround.
- // http://b/71769596
- // Locks::mutator_lock_->AssertNotHeld(self);
+ Locks::mutator_lock_->AssertNotHeld(self);
if (self->IsHandlingStackOverflow()) {
// If we are throwing a stack overflow error we probably don't have enough remaining stack
// space to run the GC.