threads/115211: pthread_atfork misbehaves in initial thread

Douglas Wells sysmaint at contek.com
Mon Aug 27 10:01:01 PDT 2007


> On Mon, 27 Aug 2007, Douglas Wells wrote:
> 
> > Yes, I can verify that using:
> > 	-pthread => erroneous behavior
> > 	-lthr => expected behavior
> > on my installation of 6.2.
> 
> The problem is that the program isn't threaded yet.  I'm not sure if
> this is really a problem since pthread_atfork() is used to protect
> and initialize data when a multi-threaded program forks.  If the
> program isn't threaded, is there really a need to do this?

No, I did not actually encounter this problem in a real program.  I came
upon it based upon a discussion elsewhere.  When I encountered the problem
on FreeBSD, I reported it with low priority.

> That said, it should work regardless.

Exactly.

> DE

 - dmw


More information about the freebsd-threads mailing list