diff options
author | Michael Chastain <mec.gnu@mindspring.com> | 2003-11-06 02:08:08 +0000 |
---|---|---|
committer | Michael Chastain <mec.gnu@mindspring.com> | 2003-11-06 02:08:08 +0000 |
commit | 2f4c035b086a900b715da99546d002e3a0318b76 (patch) | |
tree | 0728e7c0c71eab4449602930ca15d000f0bfb022 /gdb/testsuite/gdb.mi | |
parent | 8c29cdfd9c8fef3b0810ac6fde27018e16d2cf31 (diff) | |
download | gdb-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.c | 9 |
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"); } |