[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svnserve could save its PID somewhere

From: Benjamin Pflugmann <benjamin-svn-dev_at_pflugmann.de>
Date: 2004-06-22 01:38:38 CEST

On Mon 2004-06-21 at 00:28:38 +0200, Branko ??ibej wrote:
> Tobias Ringström wrote:
> >Branko ??ibej wrote:
> >
> >>Shouldn't be hard to do. You still have to catch the signal, then
> >>have the main thread simply terminate. The process should wither away
> >>once the other threads have exited, I think. But we do need the
> >>sighnal handlers. Also, svnserve should reread its config files (if
> >>any) if it sees a SIGHUP. That's just common behaviour.
> >
> >AFAIK, if you exit from main, all threads get terminated.
>
> That may be true on Unix with pthreads,

I'll try to clarify... I am not sure what "exit from main" is meant to
mean in this context, but AFAIK (with pthreads under Unix):

- calling exit() anywhere (or in any thread) will cause all threads to
  terminate.
- pthread_exit() will terminate the current thread without affecting
  the others
- "return" in main (in the main thread), is equivalent to exit()
- "return" elsewhere, is equivalent to calling pthread_exit()
  (i.e. returning from the function a specific thread was started with)

So, if it's possible to arrange to call pthread_exit(), everything
should work as needed for the suggested solution.

Bye,

        Benjamin.

PS: At least for QNX 6.2 I have actually tested that pthread_exit()
    called in the main thread will leave the others threads running as
    expected.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jun 22 01:40:57 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.