On Mar 30 14:42, Thomas Pfaff wrote:
> Corinna Vinschen wrote:
> >     void
> >     pthread::atforkchild (void)
> >     {
> >       __fp_unlock_all ();
> > 
> >       MT_INTERFACE->fixup_after_fork ();
> > 
> >       [...]
> >     }
> > 
> > Can you explain this?  Is the fix correct?
> No.
> 
> The problem is caused by cygrunsrv which is started by the service control
> manager.
> Because of this it does not have a properly initialized mainthread. When it
> locks a mutex the owner will be the pthread_null instance.After the fork the
> child will be reinitialized and the pthread_self pointer is changed,
> therefore it is no longer able to unlock a mutex which was locked by its parent.
> 
> I think that there are 2 possible workarounds:
> 
> 1. The thread which is started by the service control manager must be
> initiallized, for example in the first get_tls_self_pointer call. Chris has made
> some changes to TLS, i do not know if _my_tls  can be used for a thread that is
> created from outside.

But that can't be caused by being started by the SCM.  In theory, the
situation should be equivalent for each process started by a non-cygwin
process, isn't it?

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:[EMAIL PROTECTED]
Red Hat, Inc.

Reply via email to