diff options
author | Michael Chastain <mec@google.com> | 2003-11-06 02:08:08 +0000 |
---|---|---|
committer | Michael Chastain <mec@google.com> | 2003-11-06 02:08:08 +0000 |
commit | 2fe4e8d0d99f29e11a05ad589fc5fe78a1152da0 (patch) | |
tree | f2ae06f953c5f27f16e50a00066b549ceafc2357 /gdb/testsuite/gdb.mi/pthreads.c | |
parent | 19d87da6c7871a12afd684de61898e9ca73709c8 (diff) | |
download | gdb-2fe4e8d0d99f29e11a05ad589fc5fe78a1152da0.zip gdb-2fe4e8d0d99f29e11a05ad589fc5fe78a1152da0.tar.gz gdb-2fe4e8d0d99f29e11a05ad589fc5fe78a1152da0.tar.bz2 |
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/pthreads.c')
-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 801e013..b73b023 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"); } |