public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] Fix for pr 14236
@ 2014-07-12 20:31 Doug Evans
  0 siblings, 0 replies; only message in thread
From: Doug Evans @ 2014-07-12 20:31 UTC (permalink / raw)
  To: gdb-patches, Pedro Alves

[-- Attachment #1: Type: text/plain, Size: 204 bytes --]

Hi.
No changes in this patch.  Resubmitting for completeness sake.

2014-07-12  Doug Evans  <dje@google.com>

        * gdbthread.h (any_running): Declare.
        * thread.c (any_running): New function.

[-- Attachment #2: interrupt-v2-1.patch.txt --]
[-- Type: text/plain, Size: 1002 bytes --]

2014-07-12  Doug Evans  <dje@google.com>

	* gdbthread.h (any_running): Declare.
	* thread.c (any_running): New function.

diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 9ef74cd..ca52983 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -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.
 
diff --git a/gdb/thread.c b/gdb/thread.c
index e25d563..532149d 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -648,6 +648,18 @@ is_running (ptid_t ptid)
 }
 
 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)
 {
   struct thread_info *tp;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-12 20:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-12 20:31 [PATCH v2 1/2] Fix for pr 14236 Doug Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).