Use UndoDebuggerSuspensions for JDWP ResumeVM rather than weakening ResumeAll's checking.
Change-Id: I3ba71fb9e84664f130dd29ba8c13a8e1b6c18e46
diff --git a/src/debugger.cc b/src/debugger.cc
index 1dbcccc..604560e 100644
--- a/src/debugger.cc
+++ b/src/debugger.cc
@@ -1525,7 +1525,7 @@
}
void Dbg::ResumeVM() {
- Runtime::Current()->GetThreadList()->ResumeAll(true);
+ Runtime::Current()->GetThreadList()->UndoDebuggerSuspensions();
}
void Dbg::SuspendThread(JDWP::ObjectId threadId) {
diff --git a/src/thread_list.cc b/src/thread_list.cc
index 951a2be..186ddbc 100644
--- a/src/thread_list.cc
+++ b/src/thread_list.cc
@@ -274,7 +274,7 @@
MutexLock mu(thread_suspend_count_lock_);
for (It it = list_.begin(), end = list_.end(); it != end; ++it) {
Thread* thread = *it;
- if (thread == self || (for_debugger && thread == debug_thread) || thread->suspend_count_ == 0) {
+ if (thread == self || (for_debugger && thread == debug_thread)) {
continue;
}
ModifySuspendCount(thread, -1, for_debugger);