summaryrefslogtreecommitdiff
path: root/gdb/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/thread.c')
-rw-r--r--gdb/thread.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/thread.c b/gdb/thread.c
index 0b291bae972..4b86599c906 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -448,18 +448,18 @@ struct thread_info *
any_live_thread_of_process (int pid)
{
struct thread_info *tp;
- struct thread_info *tp_running = NULL;
+ struct thread_info *tp_executing = NULL;
for (tp = thread_list; tp; tp = tp->next)
- if (ptid_get_pid (tp->ptid) == pid)
+ if (tp->state_ != THREAD_EXITED && ptid_get_pid (tp->ptid) == pid)
{
- if (tp->state_ == THREAD_STOPPED)
+ if (tp->executing_)
+ tp_executing = tp;
+ else
return tp;
- else if (tp->state_ == THREAD_RUNNING)
- tp_running = tp;
}
- return tp_running;
+ return tp_executing;
}
/* Print a list of thread ids currently known, and the total number of