1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-09-02 16:01:20 +03:00
This commit is contained in:
Jakub Jelinek
2007-07-12 18:26:36 +00:00
parent 7d58530341
commit 0ecb606cb6
6215 changed files with 494638 additions and 305010 deletions

View File

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