summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi
diff options
context:
space:
mode:
authorMichael Chastain <mec.gnu@mindspring.com>2003-11-06 02:08:08 +0000
committerMichael Chastain <mec.gnu@mindspring.com>2003-11-06 02:08:08 +0000
commit2f4c035b086a900b715da99546d002e3a0318b76 (patch)
tree0728e7c0c71eab4449602930ca15d000f0bfb022 /gdb/testsuite/gdb.mi
parent8c29cdfd9c8fef3b0810ac6fde27018e16d2cf31 (diff)
downloadgdb-2f4c035b086a900b715da99546d002e3a0318b76.tar.gz
2003-11-05 Michael Chastain <mec@shout.net>
* gdb.mi/pthreads.c (routine): Handle early return from sleep.
Diffstat (limited to 'gdb/testsuite/gdb.mi')
-rw-r--r--gdb/testsuite/gdb.mi/pthreads.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.mi/pthreads.c b/gdb/testsuite/gdb.mi/pthreads.c
index 801e013c624..b73b0236c93 100644
--- a/gdb/testsuite/gdb.mi/pthreads.c
+++ b/gdb/testsuite/gdb.mi/pthreads.c
@@ -42,7 +42,14 @@ static pthread_attr_t null_attr;
void *
routine (void *arg)
{
- sleep (9);
+ /* When gdb is running, it sets hidden breakpoints in the thread
+ library. The signals caused by these hidden breakpoints can
+ cause system calls such as 'sleep' to return early. Pay attention
+ to the return value from 'sleep' to get the full sleep. */
+ int unslept = 9;
+ while (unslept > 0)
+ unslept = sleep (unslept);
+
printf ("hello thread\n");
}