[BACK]Return to kern_sig.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / kern

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/kern/kern_sig.c between version 1.289.4.5 and 1.289.4.5.2.1

version 1.289.4.5, 2009/04/01 21:56:50 version 1.289.4.5.2.1, 2010/01/16 17:32:45
Line 200  sigacts_poolpage_free(struct pool *pp, v
Line 200  sigacts_poolpage_free(struct pool *pp, v
 struct sigacts *  struct sigacts *
 sigactsinit(struct proc *pp, int share)  sigactsinit(struct proc *pp, int share)
 {  {
         struct sigacts *ps, *ps2;          struct sigacts *ps = pp->p_sigacts, *ps2;
   
         ps = pp->p_sigacts;          if (__predict_false(share)) {
   
         if (share) {  
                 atomic_inc_uint(&ps->sa_refcnt);                  atomic_inc_uint(&ps->sa_refcnt);
                 ps2 = ps;                  return ps;
         } else {  
                 ps2 = pool_cache_get(sigacts_cache, PR_WAITOK);  
                 /* XXXAD get rid of this */  
                 mutex_init(&ps2->sa_mutex, MUTEX_DEFAULT, IPL_SCHED);  
                 mutex_enter(&ps->sa_mutex);  
                 memcpy(&ps2->sa_sigdesc, ps->sa_sigdesc,  
                     sizeof(ps2->sa_sigdesc));  
                 mutex_exit(&ps->sa_mutex);  
                 ps2->sa_refcnt = 1;  
         }          }
           ps2 = pool_cache_get(sigacts_cache, PR_WAITOK);
           mutex_init(&ps2->sa_mutex, MUTEX_DEFAULT, IPL_SCHED);
           ps2->sa_refcnt = 1;
   
           mutex_enter(&ps->sa_mutex);
           memcpy(ps2->sa_sigdesc, ps->sa_sigdesc, sizeof(ps2->sa_sigdesc));
           mutex_exit(&ps->sa_mutex);
         return ps2;          return ps2;
 }  }
   
Line 230  sigactsinit(struct proc *pp, int share)
Line 225  sigactsinit(struct proc *pp, int share)
 void  void
 sigactsunshare(struct proc *p)  sigactsunshare(struct proc *p)
 {  {
         struct sigacts *ps, *oldps;          struct sigacts *ps, *oldps = p->p_sigacts;
   
         oldps = p->p_sigacts;          if (__predict_true(oldps->sa_refcnt == 1))
         if (oldps->sa_refcnt == 1)  
                 return;                  return;
   
         ps = pool_cache_get(sigacts_cache, PR_WAITOK);          ps = pool_cache_get(sigacts_cache, PR_WAITOK);
         /* XXXAD get rid of this */  
         mutex_init(&ps->sa_mutex, MUTEX_DEFAULT, IPL_SCHED);          mutex_init(&ps->sa_mutex, MUTEX_DEFAULT, IPL_SCHED);
         memset(&ps->sa_sigdesc, 0, sizeof(ps->sa_sigdesc));          memset(ps->sa_sigdesc, 0, sizeof(ps->sa_sigdesc));
           ps->sa_refcnt = 1;
   
         p->p_sigacts = ps;          p->p_sigacts = ps;
         sigactsfree(oldps);          sigactsfree(oldps);
 }  }

Legend:
Removed from v.1.289.4.5  
changed lines
  Added in v.1.289.4.5.2.1

CVSweb <webmaster@jp.NetBSD.org>