2003-11-05 Michael Chastain <mec@shout.net>

* gdb.mi/pthreads.c (routine): Handle early return from sleep.
This commit is contained in:
Michael Chastain 2003-11-06 02:08:08 +00:00
parent 19d87da6c7
commit 2fe4e8d0d9
2 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2003-11-05 Michael Chastain <mec@shout.net>
* gdb.mi/pthreads.c (routine): Handle early return from sleep.
2003-11-03 Kris Warkentin <kewarken@qnx.com>
* gdb.arch/gdb1291.c: New test file.

View File

@ -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");
}