Implement more DDMS support.
You can now launch DDMS without killing running oatexec processes...
Change-Id: I13e1d6df4f0cbd0c06b69471823a13e4e820b93b
diff --git a/src/thread_list.cc b/src/thread_list.cc
index f386547..0be0f09 100644
--- a/src/thread_list.cc
+++ b/src/thread_list.cc
@@ -132,12 +132,13 @@
MutexLock mu(thread_suspend_count_lock_);
for (It it = list_.begin(), end = list_.end(); it != end; ++it) {
Thread* thread = *it;
- if (thread != self && thread != debug_thread) {
- if (verbose_) {
- LOG(INFO) << "requesting thread suspend: " << *thread;
- }
- ++thread->suspend_count_;
+ if (thread == self || (for_debugger && thread == debug_thread)) {
+ continue;
}
+ if (verbose_) {
+ LOG(INFO) << "requesting thread suspend: " << *thread;
+ }
+ ++thread->suspend_count_;
}
}
@@ -157,11 +158,12 @@
*/
for (It it = list_.begin(), end = list_.end(); it != end; ++it) {
Thread* thread = *it;
- if (thread != self && thread != debug_thread) {
- thread->WaitUntilSuspended();
- if (verbose_) {
- LOG(INFO) << "thread suspended: " << *thread;
- }
+ if (thread == self || (for_debugger && thread == debug_thread)) {
+ continue;
+ }
+ thread->WaitUntilSuspended();
+ if (verbose_) {
+ LOG(INFO) << "thread suspended: " << *thread;
}
}
@@ -257,12 +259,13 @@
MutexLock mu(thread_suspend_count_lock_);
for (It it = list_.begin(), end = list_.end(); it != end; ++it) {
Thread* thread = *it;
- if (thread != self && thread != debug_thread) {
- if (thread->suspend_count_ > 0) {
- --thread->suspend_count_;
- } else {
- LOG(WARNING) << *thread << " suspend count already zero";
- }
+ if (thread == self || (for_debugger && thread == debug_thread)) {
+ continue;
+ }
+ if (thread->suspend_count_ > 0) {
+ --thread->suspend_count_;
+ } else {
+ LOG(WARNING) << *thread << " suspend count already zero";
}
}
}