Author: thompsa
Date: Wed Mar 11 00:58:22 2009
New Revision: 189658
URL: http://svn.freebsd.org/changeset/base/189658

Log:
  MFC r188548
  
   Check the exit flag at the start of the taskqueue loop rather than the end. 
It
   is possible to tear down the taskqueue before the thread has run and the
   taskqueue loop would sleep forever.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/kern/subr_taskqueue.c

Modified: stable/7/sys/kern/subr_taskqueue.c
==============================================================================
--- stable/7/sys/kern/subr_taskqueue.c  Wed Mar 11 00:29:22 2009        
(r189657)
+++ stable/7/sys/kern/subr_taskqueue.c  Wed Mar 11 00:58:22 2009        
(r189658)
@@ -397,10 +397,10 @@ taskqueue_thread_loop(void *arg)
        tqp = arg;
        tq = *tqp;
        TQ_LOCK(tq);
-       do {
+       while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0) {
                taskqueue_run(tq);
                TQ_SLEEP(tq, tq, &tq->tq_mutex, 0, "-", 0);
-       } while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0);
+       }
 
        /* rendezvous with thread that asked us to terminate */
        tq->tq_pcount--;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to