[Dr.Volker.Zell@oracle.com: Re: uxterm from xterm-185-3 and xfontsel crashing when running under cygserver support]

Corinna Vinschen vinschen@redhat.com
Tue Mar 30 13:55:00 GMT 2004


On Mar 30 15:34, Thomas Pfaff wrote:
> Regardless whether a process is started from a cygwin app or not it will
> always start at mainCRTStartup. 
> 
> When it is started by the SCM however the service_main thread is created by
> the SCM. The situation is similar to calling CreateThread instead of
> pthread_create. The thread will be handled as anonymous since it is not in the thread
> list and has not been initialized in thread_init_wrapper.

Yeah, I just realized this while in the shower.

> I think the easiest way is to modify pthread::init_mainthread in a way that
> it handles such a situation properly and will keep the pthread_self pointer
> unchanged after a fork.

Do you have an appropriate patch?

> But you can also change cygrunsrv to create a thread via pthread_create and
> fork from this thread. This should work either.

That's not the way to go, IMO.  It requires *all* Cygwin applications
written to be started under SCM to be rewritten.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.



More information about the Cygwin-patches mailing list