speedtch usbatm.h,1.4,1.5 usbatm2.c,1.13,1.14

Roman Kagan rkagan at mail.ru
Fri Jan 28 07:33:59 EST 2005


On Fri, Jan 28, 2005 at 03:28:42PM +0300, Roman Kagan wrote:
> On Fri, Jan 28, 2005 at 12:11:08PM +0000, Duncan Sands wrote:
> > @@ -1021,24 +1001,35 @@
> >  	daemonize("%s/%s", usbatm_driver_name, instance->driver->driver_name);
> >  	allow_signal(SIGTERM);
> >  
> > +	complete(&instance->thread_started);
> > +
> >  	ret = instance->driver->heavy_init(instance, instance->usb_intf);
> >  
> >  	if (!ret)
> >  		ret = usbatm_atm_init(instance);
> >  
> > -	complete_and_exit(&instance->thread_exited, ret);
> > +	down(&instance->serialize);
> > +	instance->thread_pid = -1;
> > +	complete(&instance->thread_exited);
> > +	up(&instance->serialize);
> > +
> > +	return ret;
> >  }
> 
> Don't you need to install a SIGTERM handler?  It looks you can never
> reach here without it, and then the ->thread_exited completion will
> never be signalled.

Even more so: you're relying on the .heavy_init to be prepared to be
SIGTERMed at any time.  This IMO is a much stronger assumption than
its being quick to exit.

Roman.



More information about the Usbatm mailing list