summaryrefslogtreecommitdiff
path: root/sys/kern/kern_event.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2001-01-24 00:35:12 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2001-01-24 00:35:12 +0000
commite5690aadaa4022bff9b38e68d3eded7918e11c26 (patch)
tree466620d63ed8c9cc2e5240d55a93d9dae3fdbb23 /sys/kern/kern_event.c
parenta914fb6b27c9e4bca79cf2c4b7f568777347e0d3 (diff)
Notes
Diffstat (limited to 'sys/kern/kern_event.c')
-rw-r--r--sys/kern/kern_event.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index 1a89d3248896..c1604d2af5c2 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -215,8 +215,9 @@ filt_procattach(struct knote *kn)
kn->kn_flags &= ~EV_FLAG1;
}
- /* XXX lock the proc here while adding to the list? */
+ PROC_LOCK(p);
SLIST_INSERT_HEAD(&p->p_klist, kn, kn_selnext);
+ PROC_UNLOCK(p);
return (0);
}
@@ -237,8 +238,9 @@ filt_procdetach(struct knote *kn)
if (kn->kn_status & KN_DETACHED)
return;
- /* XXX locking? this might modify another process. */
+ PROC_LOCK(p);
SLIST_REMOVE(&p->p_klist, kn, knote, kn_selnext);
+ PROC_UNLOCK(p);
}
static int