Back to index

glibc  2.9
Functions
joinrace.c File Reference
#include <errno.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

static void * sub1 (void *arg)
int main (void)

Function Documentation

int main ( void  )

Definition at line 16 of file joinrace.c.

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

Here is the call graph for this function:

static void* sub1 ( void *  arg) [static]

Definition at line 9 of file joinrace.c.

{
  /* Nothing.  */
  return NULL;
}

Here is the caller graph for this function: