summaryrefslogtreecommitdiffstats
path: root/sys/sys/event.h
diff options
context:
space:
mode:
authorvisa <visa@openbsd.org>2020-12-25 12:59:51 +0000
committervisa <visa@openbsd.org>2020-12-25 12:59:51 +0000
commit9b0cf67b268a857fffa6a742ad6be57acdc35301 (patch)
treecdb461f14f3d46558aedb56eba5cc939b03dad6f /sys/sys/event.h
parentSmall smr_grace_wait() optimization (diff)
downloadwireguard-openbsd-9b0cf67b268a857fffa6a742ad6be57acdc35301.tar.xz
wireguard-openbsd-9b0cf67b268a857fffa6a742ad6be57acdc35301.zip
Refactor klist insertion and removal
Rename klist_{insert,remove}() to klist_{insert,remove}_locked(). These functions assume that the caller has locked the klist. The current state of locking remains intact because the kernel lock is still used with all klists. Add new functions klist_insert() and klist_remove() that lock the klist internally. This allows some code simplification. OK mpi@
Diffstat (limited to 'sys/sys/event.h')
-rw-r--r--sys/sys/event.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/sys/event.h b/sys/sys/event.h
index c8160f4cc55..1ab010b9a21 100644
--- a/sys/sys/event.h
+++ b/sys/sys/event.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: event.h,v 1.51 2020/12/20 12:54:05 visa Exp $ */
+/* $OpenBSD: event.h,v 1.52 2020/12/25 12:59:53 visa Exp $ */
/*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
@@ -246,7 +246,9 @@ extern void klist_init_mutex(struct klist *, struct mutex *);
extern void klist_init_rwlock(struct klist *, struct rwlock *);
extern void klist_free(struct klist *);
extern void klist_insert(struct klist *, struct knote *);
+extern void klist_insert_locked(struct klist *, struct knote *);
extern void klist_remove(struct klist *, struct knote *);
+extern void klist_remove_locked(struct klist *, struct knote *);
extern int klist_empty(struct klist *);
extern void klist_invalidate(struct klist *);