summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_bufq.c
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2010-09-01 19:23:05 +0000
committerkettenis <kettenis@openbsd.org>2010-09-01 19:23:05 +0000
commit74277713be70dd4b0f948cd15c6aeb53c8974b15 (patch)
tree4d9db22834c93a725fba89482993a492d0f7d502 /sys/kern/kern_bufq.c
parentFix typo in vgafb_mmap(), causing a comparison to always fail. ok kettenis@ (diff)
downloadwireguard-openbsd-74277713be70dd4b0f948cd15c6aeb53c8974b15.tar.xz
wireguard-openbsd-74277713be70dd4b0f948cd15c6aeb53c8974b15.zip
Clarify why we can walk the list of bufqs without holding a mutex with a
comment.
Diffstat (limited to 'sys/kern/kern_bufq.c')
-rw-r--r--sys/kern/kern_bufq.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/kern_bufq.c b/sys/kern/kern_bufq.c
index adff3cc4ada..f196e59fa15 100644
--- a/sys/kern/kern_bufq.c
+++ b/sys/kern/kern_bufq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_bufq.c,v 1.15 2010/09/01 01:38:12 dlg Exp $ */
+/* $OpenBSD: kern_bufq.c,v 1.16 2010/09/01 19:23:05 kettenis Exp $ */
/*
* Copyright (c) 2010 Thordur I. Bjornsson <thib@openbsd.org>
*
@@ -244,7 +244,11 @@ bufq_quiesce(void)
mtx_enter(&bufqs_mtx);
bufqs_stop = 1;
mtx_leave(&bufqs_mtx);
- SLIST_FOREACH(bq, &bufqs, bufq_entries) { /* XXX */
+ /*
+ * We can safely walk the list since it can't be modified as
+ * long as bufqs_stop is non-zero.
+ */
+ SLIST_FOREACH(bq, &bufqs, bufq_entries) {
mtx_enter(&bq->bufq_mtx);
bq->bufq_stop = 1;
while (bq->bufq_outstanding) {