Received: from SOUTH-STATION-ANNEX.MIT.EDU by po7.MIT.EDU (5.61/4.7) id AA03215; Wed, 14 Feb 96 14:41:26 EST
Received: from [205.150.46.5] by MIT.EDU with SMTP
	id AA16871; Wed, 14 Feb 96 14:40:56 EST
Received: (from green@localhost) by hoser.cygnus.com (8.7.1/8.7.1) id OAA19380; Wed, 14 Feb 1996 14:40:29 -0500
Date: Wed, 14 Feb 1996 14:40:29 -0500
Message-Id: <199602141940.OAA19380@hoser.cygnus.com>
From: RHS Linux User <green@hoser.cygnus.com>
To: proven@MIT.EDU
Subject: more pthreads questions
Reply-To: green@cygnus.com


My multithreaded Guile is getting cooler by the day. The garbage collector
is bahaving properly, but I still have some signal handling troubles
to work out.

Here's a little C program that doesn't behave properly when I build
and link against 1.60 beta 4.1. It hangs under Linux 1.2.13.
Any ideas? 

---- cut here ----------------------------------------------------
#include <stdio.h>
#include <signal.h>
#include <sys/wait.h>

int gotSignal = 0;

sigProc(sig)
     int sig;
{
  gotSignal = 1;
}

main()
{
  int pid, sts;
  (void) signal(SIGCHLD, sigProc);
  pid = vfork();
  if (pid <  0) {
    exit(1);
  } else if (pid == 0) {
    (void) signal(SIGCHLD, SIG_DFL);
    _exit(0);
  } else {
    (void) wait(&sts);
  }
  printf("%d\n", gotSignal);
  exit((gotSignal) ? 0 : 1);
}

---- cut here ----------------------------------------------------

Anthony

