mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 08:11:08 +00:00
Update.
* joinrace.c: New file.
This commit is contained in:
parent
41b37cb517
commit
15109bd4aa
@ -7,6 +7,7 @@
|
|||||||
* join.c (pthread_join): Use nonexisting_handle instead of
|
* join.c (pthread_join): Use nonexisting_handle instead of
|
||||||
invalid_handle to test for acceptable thread handle.
|
invalid_handle to test for acceptable thread handle.
|
||||||
* manager.c (pthread_handle_free): Likewise.
|
* manager.c (pthread_handle_free): Likewise.
|
||||||
|
* joinrace.c: New file.
|
||||||
Reported by Permaine Cheung <pcheung@cygnus.com>.
|
Reported by Permaine Cheung <pcheung@cygnus.com>.
|
||||||
|
|
||||||
2000-06-08 Ulrich Drepper <drepper@redhat.com>
|
2000-06-08 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
48
linuxthreads/joinrace.c
Normal file
48
linuxthreads/joinrace.c
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/* Test case by Permaine Cheung <pcheung@cygnus.com>. */
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
void *
|
||||||
|
sub1 (void *arg)
|
||||||
|
{
|
||||||
|
/* Nothing. */
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main (void)
|
||||||
|
{
|
||||||
|
int istatus;
|
||||||
|
int policy;
|
||||||
|
int cnt;
|
||||||
|
pthread_t thread1;
|
||||||
|
struct sched_param spresult1, sp1;
|
||||||
|
|
||||||
|
for (cnt = 0; cnt < 100; ++cnt)
|
||||||
|
{
|
||||||
|
printf ("Round %d\n", cnt);
|
||||||
|
|
||||||
|
pthread_create (&thread1, NULL, &sub1, NULL);
|
||||||
|
pthread_join (thread1, NULL);
|
||||||
|
|
||||||
|
istatus = pthread_getschedparam (thread1, &policy, &spresult1);
|
||||||
|
if (istatus != ESRCH)
|
||||||
|
{
|
||||||
|
printf ("pthread_getschedparam returns: %d\n", istatus);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
sp1.sched_priority = 0;
|
||||||
|
istatus = pthread_setschedparam (thread1, SCHED_OTHER, &sp1);
|
||||||
|
if (istatus != ESRCH)
|
||||||
|
{
|
||||||
|
printf ("pthread_setschedparam returns: %d\n", istatus);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user