]> sourceware.org Git - glibc.git/blame - linuxthreads/joinrace.c
* pthread.c (__pthread_reset_main_thread) [FLOATING_STACKS]:
[glibc.git] / linuxthreads / joinrace.c
CommitLineData
15109bd4
UD
1/* Test case by Permaine Cheung <pcheung@cygnus.com>. */
2
3#include <errno.h>
4#include <pthread.h>
5#include <stdio.h>
6#include <stdlib.h>
7
de149cdb 8static void *
15109bd4
UD
9sub1 (void *arg)
10{
11 /* Nothing. */
12 return NULL;
13}
14
15int
16main (void)
17{
18 int istatus;
19 int policy;
20 int cnt;
21 pthread_t thread1;
22 struct sched_param spresult1, sp1;
23
24 for (cnt = 0; cnt < 100; ++cnt)
25 {
26 printf ("Round %d\n", cnt);
27
28 pthread_create (&thread1, NULL, &sub1, NULL);
29 pthread_join (thread1, NULL);
30
31 istatus = pthread_getschedparam (thread1, &policy, &spresult1);
32 if (istatus != ESRCH)
33 {
34 printf ("pthread_getschedparam returns: %d\n", istatus);
35 return 1;
36 }
37
38 sp1.sched_priority = 0;
39 istatus = pthread_setschedparam (thread1, SCHED_OTHER, &sp1);
40 if (istatus != ESRCH)
41 {
42 printf ("pthread_setschedparam returns: %d\n", istatus);
43 return 2;
44 }
45 }
46
47 return 0;
48}
This page took 0.102392 seconds and 5 git commands to generate.