diff options
author | Roland McGrath <roland@gnu.org> | 2005-07-03 04:40:34 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2005-07-03 04:40:34 +0000 |
commit | 88e3fbcb5d6829f8980d6bb356b1c0cd7a38187b (patch) | |
tree | 41b73f55c91439f87d82e5d32b9d8e46e82ce3c1 /linuxthreads/bug-sleep.c | |
parent | d19b1b4f2ff49e085b55e8564b52ca17b028e335 (diff) | |
download | glibc-88e3fbcb5d6829f8980d6bb356b1c0cd7a38187b.zip glibc-88e3fbcb5d6829f8980d6bb356b1c0cd7a38187b.tar.gz glibc-88e3fbcb5d6829f8980d6bb356b1c0cd7a38187b.tar.bz2 |
linuxthreads, linuxthreads_db: Directories removed (preserved in ports repository).
Diffstat (limited to 'linuxthreads/bug-sleep.c')
-rw-r--r-- | linuxthreads/bug-sleep.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/linuxthreads/bug-sleep.c b/linuxthreads/bug-sleep.c deleted file mode 100644 index f29a6b7..0000000 --- a/linuxthreads/bug-sleep.c +++ /dev/null @@ -1,34 +0,0 @@ -/* PR libc/4005 */ -#include <pthread.h> -#include <stdio.h> -#include <unistd.h> -#include <time.h> - -void * -run_thread (void *a) -{ - while (1) - { - sleep (10); - } - return 0; -} - -int -main (void) -{ - pthread_t thr; - void *result; - alarm (4); - printf ("Starting thread.\n"); - pthread_create (&thr, 0, run_thread, 0); - sleep (2); - printf ("Canceling thread.\n"); - pthread_cancel (thr); - pthread_join (thr, &result); - if (result == PTHREAD_CANCELED) - printf ("Thread canceled.\n"); - else - printf ("Thread exited.\n"); - return 0; -} |