Fix DumpUnattachedThreads logic for CTS.
The thread should not be in thread list when dumping from
DumpUnattachedThread.
Bug:140968481
Bug:188918448
Bug:188918454
Test: CtsWindowManagerDeviceTestCases android.server.wm.AnrTests
Signed-off-by: wangguibo <wangguibo@xiaomi.com>
Merged-In: Icc4c7907c5386280c04d8e56496361e32cbac350
Change-Id: Icc4c7907c5386280c04d8e56496361e32cbac350
(cherry picked from commit 530552ac735c59a3ae44b16f751df265e820dad2)
diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc
index e0d62d0..f8e99e8 100644
--- a/runtime/thread_list.cc
+++ b/runtime/thread_list.cc
@@ -175,7 +175,7 @@
MutexLock mu(self, *Locks::thread_list_lock_);
thread = FindThreadByTid(tid);
}
- if (thread != nullptr) {
+ if (thread == nullptr) {
DumpUnattachedThread(os, tid, dump_native_stack);
}
}