* gdbthread.h (any_running): Declare.

* thread.c (any_running): New function.
This commit is contained in:
Doug Evans 2014-07-10 11:15:32 -07:00
parent e7d17e71cd
commit 1a76d59888
3 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2014-07-10 Doug Evans <dje@google.com>
* gdbthread.h (any_running): Declare.
* thread.c (any_running): New function.
2014-07-09 Pedro Alves <palves@redhat.com>
* infcmd.c (attach_command_post_wait): Don't call

View File

@ -363,6 +363,9 @@ extern int is_exited (ptid_t ptid);
/* In the frontend's perpective, is this thread stopped? */
extern int is_stopped (ptid_t ptid);
/* In the frontend's perpective is there any thread running? */
extern int any_running (void);
/* Marks thread PTID as executing, or not. If ptid_get_pid (PTID) is -1,
marks all threads.

View File

@ -647,6 +647,18 @@ is_running (ptid_t ptid)
return is_thread_state (ptid, THREAD_RUNNING);
}
int
any_running (void)
{
struct thread_info *tp;
for (tp = thread_list; tp; tp = tp->next)
if (tp->state == THREAD_RUNNING)
return 1;
return 0;
}
int
is_executing (ptid_t ptid)
{