Subject: Re: Problems with threads in Linux emulation
To: Matthias Scheler <>
From: Matthew Orgass <>
List: tech-kern
Date: 09/10/2000 02:58:30
On 9 Sep 2000, Matthias Scheler wrote:

> As you can see it only creates a number of threads which print out a
> message and terminate afterwards. If you invoke that program under
> Linux with an arbitrary number of threads it works fine. Under NetBSD
> it works fine if only one thread is created. But if more than one thread
> is created the main program hangs after printing "main process finished".
> While it is hanging two processes are left:
> Any ideas what is going on here?

  The problem is that old signal masks are in the sigacts structure which
is shared when signal handlers are shared.  In some cases, the thread
library has several threads sigsuspending at once, so when the first
thread wakes up it clears the SAS_OLDMASK flag for all of them, leaving
the rest with the sigsuspend mask.  I'll submit a PR with a patch as soon
as I have a working patch. 

Matthew Orgass