svn commit: r268074 - head/sys/kern

Mateusz Guzik mjguzik at gmail.com
Tue Jul 1 14:19:26 UTC 2014


On Tue, Jul 01, 2014 at 09:40:57AM -0400, John Baldwin wrote:
> On Tuesday, July 01, 2014 2:29:15 am Mateusz Guzik wrote:
> > Modified: head/sys/kern/kern_sig.c
> > 
> ==============================================================================
> > --- head/sys/kern/kern_sig.c	Tue Jul  1 06:23:48 2014	(r268073)
> > +++ head/sys/kern/kern_sig.c	Tue Jul  1 06:29:15 2014	(r268074)
> > @@ -3453,10 +3453,6 @@ sigacts_copy(struct sigacts *dest, struc
> >  int
> >  sigacts_shared(struct sigacts *ps)
> >  {
> > -	int shared;
> >  
> > -	mtx_lock(&ps->ps_mtx);
> > -	shared = ps->ps_refcnt > 1;
> > -	mtx_unlock(&ps->ps_mtx);
> > -	return (shared);
> > +	return (ps->ps_refcnt > 1);
> >  }
> 
> You should KASSERT() in sigacts_shared that P_HADTHREADS is not set so that 
> new code does not call this function unsafely in the future.
> 

Looks more like !P_HADTHREADS || p->p_singlethread != NULL on the first
sight, but yeah, I'll add an assertion.

Thanks,
-- 
Mateusz Guzik <mjguzik gmail.com>


More information about the svn-src-head mailing list