summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2018-02-06 18:35:41 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-02-06 18:35:41 +0000
commit8bcecf915545581bf23b5348cd94d3f5ec6eb669 (patch)
tree99146665aa76b27adb7d253cc8e14a48894207d4
parent045112c32ca814be43c5965de3b3006d313cfc90 (diff)
parente11d50f23dc1256ad933d209f2db8f58138f02c0 (diff)
Merge "Workaround bogus Thread Safety Analysis warning"
-rw-r--r--adbconnection/adbconnection.cc5
-rw-r--r--runtime/gc/heap.cc15
2 files changed, 16 insertions, 4 deletions
diff --git a/adbconnection/adbconnection.cc b/adbconnection/adbconnection.cc
index 6b82be6193..a0c99663b4 100644
--- a/adbconnection/adbconnection.cc
+++ b/adbconnection/adbconnection.cc
@@ -555,7 +555,10 @@ bool AdbConnectionState::SetupAdbConnection() {
void AdbConnectionState::RunPollLoop(art::Thread* self) {
CHECK_NE(agent_name_, "");
CHECK_EQ(self->GetState(), art::kNative);
- art::Locks::mutator_lock_->AssertNotHeld(self);
+ // 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
+ // art::Locks::mutator_lock_->AssertNotHeld(self);
self->SetState(art::kWaitingInMainDebuggerLoop);
// shutting_down_ set by StopDebuggerThreads
while (!shutting_down_) {
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index b1932d1a29..cf5bd4aed2 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -1890,7 +1890,10 @@ HomogeneousSpaceCompactResult Heap::PerformHomogeneousSpaceCompact() {
count_requested_homogeneous_space_compaction_++;
// Store performed homogeneous space compaction at a new request arrival.
ScopedThreadStateChange tsc(self, kWaitingPerformingGc);
- Locks::mutator_lock_->AssertNotHeld(self);
+ // 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);
{
ScopedThreadStateChange tsc2(self, kWaitingForGcToComplete);
MutexLock mu(self, *gc_complete_lock_);
@@ -1968,7 +1971,10 @@ void Heap::TransitionCollector(CollectorType collector_type) {
Runtime* const runtime = Runtime::Current();
Thread* const self = Thread::Current();
ScopedThreadStateChange tsc(self, kWaitingPerformingGc);
- Locks::mutator_lock_->AssertNotHeld(self);
+ // 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);
// Busy wait until we can GC (StartGC can fail if we have a non-zero
// compacting_gc_disable_count_, this should rarely occurs).
for (;;) {
@@ -2511,7 +2517,10 @@ collector::GcType Heap::CollectGarbageInternal(collector::GcType gc_type,
}
}
ScopedThreadStateChange tsc(self, kWaitingPerformingGc);
- Locks::mutator_lock_->AssertNotHeld(self);
+ // 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);
if (self->IsHandlingStackOverflow()) {
// If we are throwing a stack overflow error we probably don't have enough remaining stack
// space to run the GC.