From: Julian Seward Date: Sun, 11 Nov 2007 05:52:36 +0000 (+0000) Subject: Don't hang on some old systems, since that makes the entire regtest X-Git-Tag: svn/VALGRIND_3_3_0~147 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=565f0a4d32d625074dbb1c90c1f6fd268fd21a20;p=thirdparty%2Fvalgrind.git Don't hang on some old systems, since that makes the entire regtest system hang. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7143 --- diff --git a/helgrind/tests/tc18_semabuse.c b/helgrind/tests/tc18_semabuse.c index 6e26ce411d..1fbc41928f 100644 --- a/helgrind/tests/tc18_semabuse.c +++ b/helgrind/tests/tc18_semabuse.c @@ -6,19 +6,19 @@ /* This is pretty lame, because making the sem_ functions fail is difficult. Not sure it's really worth having. */ - +#include #include #include #include #include #include #include - +void start_watchdog ( void ); int main ( void ) { int r; sem_t s1; - + start_watchdog(); /* Do sem_init with huge initial count */ r= sem_init(&s1, 0, ~0); @@ -40,3 +40,18 @@ int main ( void ) return 0; } + +void* watchdog ( void* v ) +{ + sleep(10); + fprintf(stderr, "watchdog timer expired - not a good sign\n"); + exit(0); +} + +void start_watchdog ( void ) +{ + pthread_t t; + int r; + r= pthread_create(&t, NULL, watchdog, NULL); + assert(!r); +}