Sophie

Sophie

distrib > Mandriva > 2006.0 > x86_64 > by-pkgid > dc3ffd43ffec69bdf5de9a720a767df1 > files > 2014

glibc-devel-2.3.6-4.1.20060mdk.x86_64.rpm

/* Tst case by Jakub Jelinek <jakub@redhat.com>.  */
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>

static void *
task (void *p)
{
  sleep (30);
  return NULL;
}

int
main (void)
{
  pthread_t t;
  int status;

  status = pthread_create (&t, NULL, task, NULL);
  if (status)
    exit (status);

  status = pthread_detach (t);
  pthread_kill_other_threads_np ();
  return status;
}