patches/gdb/6.4/120-thread-timeout.patch
changeset 1617 7d70bcf940a9
parent 1602 1ba79f2126df
parent 1616 1fda13e5d961
child 1618 7f52e1cca71e
     1.1 --- a/patches/gdb/6.4/120-thread-timeout.patch	Wed Oct 28 12:03:38 2009 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,34 +0,0 @@
     1.4 ---- gdb-6.3.org/gdb/gdbserver/thread-db.c	2004-10-17 02:42:00.000000000 +0900
     1.5 -+++ gdb-6.3/gdb/gdbserver/thread-db.c	2005-01-27 12:19:29.000000000 +0900
     1.6 -@@ -21,6 +21,7 @@
     1.7 -    Foundation, Inc., 59 Temple Place - Suite 330,
     1.8 -    Boston, MA 02111-1307, USA.  */
     1.9 - 
    1.10 -+#include <unistd.h>
    1.11 - #include "server.h"
    1.12 - 
    1.13 - #include "linux-low.h"
    1.14 -@@ -142,6 +143,7 @@
    1.15 -   td_event_msg_t msg;
    1.16 -   td_err_e err;
    1.17 -   struct inferior_linux_data *tdata;
    1.18 -+  int timeout;
    1.19 - 
    1.20 -   if (debug_threads)
    1.21 -     fprintf (stderr, "Thread creation event.\n");
    1.22 -@@ -152,7 +154,13 @@
    1.23 -      In the LinuxThreads implementation, this is safe,
    1.24 -      because all events come from the manager thread
    1.25 -      (except for its own creation, of course).  */
    1.26 --  err = td_ta_event_getmsg (thread_agent, &msg);
    1.27 -+  for (timeout = 0; timeout < 50000; timeout++)
    1.28 -+    {
    1.29 -+      err = td_ta_event_getmsg (thread_agent, &msg);
    1.30 -+      if (err != TD_NOMSG)
    1.31 -+	break;
    1.32 -+      usleep(1000);
    1.33 -+    }
    1.34 -   if (err != TD_OK)
    1.35 -     fprintf (stderr, "thread getmsg err: %s\n",
    1.36 - 	     thread_db_err_str (err));
    1.37 -