[PATCH 2/3] run-command: factor out running_main_thread function

2013-04-15 Thread Jeff King
When the async subsystem is used, we may spawn off sub-threads (if the platform supports it), and consider the original thread to be the "main" thread of execution. We use this information in a custom die_routine to decide whether to call pthread_exit or a regular full-process exit. Let's pull thi

Re: [PATCH 2/3] run-command: factor out running_main_thread function

2013-04-15 Thread Jonathan Nieder
Jeff King wrote: > --- a/run-command.c > +++ b/run-command.c > @@ -603,7 +603,7 @@ static NORETURN void die_async(const char *err, va_list > params) > { > vreportf("fatal: ", err, params); > > - if (!pthread_equal(main_thread, pthread_self())) { > + if (!running_main_thread()) {

Re: [PATCH 2/3] run-command: factor out running_main_thread function

2013-04-15 Thread Jeff King
On Mon, Apr 15, 2013 at 06:45:04PM -0700, Jonathan Nieder wrote: > Jeff King wrote: > > > --- a/run-command.c > > +++ b/run-command.c > > @@ -603,7 +603,7 @@ static NORETURN void die_async(const char *err, va_list > > params) > > { > > vreportf("fatal: ", err, params); > > > > - if (!pt