[BACK]Return to kern_sleepq.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_sleepq.c between version 1.31 and 1.32

version 1.31, 2008/05/31 21:26:01 version 1.32, 2008/06/16 10:02:15
Line 437  sleepq_changepri(lwp_t *l, pri_t pri)
Line 437  sleepq_changepri(lwp_t *l, pri_t pri)
   
         opri = lwp_eprio(l);          opri = lwp_eprio(l);
         l->l_priority = pri;          l->l_priority = pri;
         if (lwp_eprio(l) != opri) {  
                 TAILQ_REMOVE(sq, l, l_sleepchain);          if (lwp_eprio(l) == opri) {
                 sleepq_insert(sq, l, l->l_syncobj);                  return;
           }
           if ((l->l_syncobj->sobj_flag & SOBJ_SLEEPQ_SORTED) == 0) {
                   return;
           }
   
           /*
            * Don't let the sleep queue become empty, even briefly.
            * cv_signal() and cv_broadcast() inspect it without the
            * sleep queue lock held and need to see a non-empty queue
            * head if there are waiters.
            */
           if (TAILQ_FIRST(sq) == l && TAILQ_NEXT(l, l_sleepchain) == NULL) {
                   return;
         }          }
           TAILQ_REMOVE(sq, l, l_sleepchain);
           sleepq_insert(sq, l, l->l_syncobj);
 }  }
   
 void  void
Line 454  sleepq_lendpri(lwp_t *l, pri_t pri)
Line 469  sleepq_lendpri(lwp_t *l, pri_t pri)
         opri = lwp_eprio(l);          opri = lwp_eprio(l);
         l->l_inheritedprio = pri;          l->l_inheritedprio = pri;
   
         if (lwp_eprio(l) != opri &&          if (lwp_eprio(l) == opri) {
             (l->l_syncobj->sobj_flag & SOBJ_SLEEPQ_SORTED) != 0) {                  return;
                 TAILQ_REMOVE(sq, l, l_sleepchain);          }
                 sleepq_insert(sq, l, l->l_syncobj);          if ((l->l_syncobj->sobj_flag & SOBJ_SLEEPQ_SORTED) == 0) {
                   return;
           }
   
           /*
            * Don't let the sleep queue become empty, even briefly.
            * cv_signal() and cv_broadcast() inspect it without the
            * sleep queue lock held and need to see a non-empty queue
            * head if there are waiters.
            */
           if (TAILQ_FIRST(sq) == l && TAILQ_NEXT(l, l_sleepchain) == NULL) {
                   return;
         }          }
           TAILQ_REMOVE(sq, l, l_sleepchain);
           sleepq_insert(sq, l, l->l_syncobj);
 }  }

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32

CVSweb <webmaster@jp.NetBSD.org>