Back to index

glibc  2.9
Defines | Functions
tst-detach1.c File Reference
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "../test-skeleton.c"

Go to the source code of this file.

Defines

#define TEST_FUNCTION   do_test ()

Functions

static void * tf (void *arg)
static int do_test (void)

Define Documentation

#define TEST_FUNCTION   do_test ()

Definition at line 55 of file tst-detach1.c.


Function Documentation

static int do_test ( void  ) [static]

Definition at line 34 of file tst-detach1.c.

{
  pthread_t th;
  if (pthread_create (&th, NULL, tf, (void *) pthread_self ()) != 0)
    {
      puts ("create failed");
      exit (1);
    }

  /* Give the child a chance to finish.  */
  sleep (1);

  if (pthread_detach (th) != 0)
    {
      puts ("detach failed");
      exit (1);
    }

  return 0;
}

Here is the call graph for this function:

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

Definition at line 27 of file tst-detach1.c.

{
  return NULL;
}