Re: Fix foll-fork.exp foll-vfork.exp fork-child-threads.exp

Daniel Jacobowitz
2008-12-01T20:56:30Z

On Mon, Dec 01, 2008 at 10:58:31AM -0800, Michael Snyder wrote:
> I'm not sure if this change goes far enough.
> If a multi-threaded program forks, only the currently
> executing thread survives in the child. All others are
> left behind (and its not unlikely that the thread library
> is left in an inconsistant state, possibly leading to
> deadlocks).

If you use fork () rather than syscall (SYS_fork), the thread library
ought to clean up first; this is a POSIX supported functionality, I
believe. I know it works with glibc and on Solaris. Of course,
Solaris has rfork too which copies threads...

--
Daniel Jacobowitz
CodeSourcery