Back to index

glibc  2.9
Defines | Functions
ex10.c File Reference
#include <errno.h>
#include <error.h>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <time.h>

Go to the source code of this file.


#define NUM_THREADS   10
#define NUM_ITERS   50
#define TIMEOUT_NS   100000000L


static void * thread (void *)

Define Documentation

#define NUM_ITERS   50

Definition at line 28 of file ex10.c.

#define NUM_THREADS   10

Definition at line 27 of file ex10.c.

#define TIMEOUT_NS   100000000L

Definition at line 29 of file ex10.c.

Function Documentation

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

Definition at line 31 of file ex10.c.

  pthread_t th;
  int i;

  for (i = 0; i < NUM_THREADS; i++)
      if (pthread_create (&th, NULL, thread, NULL) != 0)
       error (EXIT_FAILURE, 0, "cannot create thread");

  (void) thread (NULL);
  /* notreached */
  return 0;

Here is the call graph for this function:

Here is the caller graph for this function: