summaryrefslogtreecommitdiffstats
path: root/sys/dev/iscsi
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-01-03 18:35:29 +0000
committermav <mav@FreeBSD.org>2015-01-03 18:35:29 +0000
commit7101d2a057890b98bcb97f92108dab7b0c911977 (patch)
tree4b3672efbc0796340e29e34c662c3bfb5712a94e /sys/dev/iscsi
parente64ce6e7377c92eae930d1d6a616e0b2a13ca94b (diff)
downloadFreeBSD-src-7101d2a057890b98bcb97f92108dab7b0c911977.zip
FreeBSD-src-7101d2a057890b98bcb97f92108dab7b0c911977.tar.gz
MFC r272765: Remove one second wait for threads exit from icl_conn_close().
Switch it from polling with pause() to using cv_wait()/cv_signal().
Diffstat (limited to 'sys/dev/iscsi')
-rw-r--r--sys/dev/iscsi/icl.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/iscsi/icl.c b/sys/dev/iscsi/icl.c
index f73ef96..3725899 100644
--- a/sys/dev/iscsi/icl.c
+++ b/sys/dev/iscsi/icl.c
@@ -776,6 +776,7 @@ icl_receive_thread(void *arg)
ICL_CONN_LOCK(ic);
ic->ic_receive_running = false;
+ cv_signal(&ic->ic_send_cv);
ICL_CONN_UNLOCK(ic);
kthread_exit();
}
@@ -1026,6 +1027,7 @@ icl_send_thread(void *arg)
STAILQ_CONCAT(&ic->ic_to_send, &queue);
ic->ic_send_running = false;
+ cv_signal(&ic->ic_send_cv);
ICL_CONN_UNLOCK(ic);
kthread_exit();
}
@@ -1330,15 +1332,11 @@ icl_conn_close(struct icl_conn *ic)
/*
* Wake up the threads, so they can properly terminate.
*/
- cv_signal(&ic->ic_receive_cv);
- cv_signal(&ic->ic_send_cv);
while (ic->ic_receive_running || ic->ic_send_running) {
//ICL_DEBUG("waiting for send/receive threads to terminate");
- ICL_CONN_UNLOCK(ic);
cv_signal(&ic->ic_receive_cv);
cv_signal(&ic->ic_send_cv);
- pause("icl_close", 1 * hz);
- ICL_CONN_LOCK(ic);
+ cv_wait(&ic->ic_send_cv, ic->ic_lock);
}
//ICL_DEBUG("send/receive threads terminated");
OpenPOWER on IntegriCloud