svn commit: r256623 - projects/camlock/sys/cam

Alexander Motin mav at FreeBSD.org
Wed Oct 16 12:15:34 UTC 2013


Author: mav
Date: Wed Oct 16 12:15:33 2013
New Revision: 256623
URL: http://svnweb.freebsd.org/changeset/base/256623

Log:
  Oops, fix for r256622: put THREAD_NO_SLEEPING() into the better place.

Modified:
  projects/camlock/sys/cam/cam_xpt.c

Modified: projects/camlock/sys/cam/cam_xpt.c
==============================================================================
--- projects/camlock/sys/cam/cam_xpt.c	Wed Oct 16 12:13:20 2013	(r256622)
+++ projects/camlock/sys/cam/cam_xpt.c	Wed Oct 16 12:15:33 2013	(r256623)
@@ -5265,7 +5265,6 @@ xpt_done_td(void *arg)
 	STAILQ_HEAD(, ccb_hdr)	doneq;
 
 	STAILQ_INIT(&doneq);
-	THREAD_NO_SLEEPING();
 	mtx_lock(&queue->cam_doneq_mtx);
 	while (1) {
 		while (STAILQ_EMPTY(&queue->cam_doneq)) {
@@ -5277,11 +5276,13 @@ xpt_done_td(void *arg)
 		STAILQ_CONCAT(&doneq, &queue->cam_doneq);
 		mtx_unlock(&queue->cam_doneq_mtx);
 
+		THREAD_NO_SLEEPING();
 		while ((ccb_h = STAILQ_FIRST(&doneq)) != NULL) {
 			STAILQ_REMOVE_HEAD(&doneq, sim_links.stqe);
 			ccb_h->pinfo.index = CAM_UNQUEUED_INDEX;
 			xpt_done_process(ccb_h);
 		}
+		THREAD_SLEEPING_OK();
 
 		mtx_lock(&queue->cam_doneq_mtx);
 	}


More information about the svn-src-projects mailing list