summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_pool.c
diff options
context:
space:
mode:
authormatthew <matthew@openbsd.org>2010-09-21 01:09:10 +0000
committermatthew <matthew@openbsd.org>2010-09-21 01:09:10 +0000
commitf93b44b3e48f4dd0c0aedc62090697e24ede730e (patch)
treeb8af3700f14ea0294a59059864f546d4a65d02b7 /sys/kern/subr_pool.c
parentmclgeti() support for xl(4). All done by Loganaden Velvindron. (diff)
downloadwireguard-openbsd-f93b44b3e48f4dd0c0aedc62090697e24ede730e.tar.xz
wireguard-openbsd-f93b44b3e48f4dd0c0aedc62090697e24ede730e.zip
Add assertwaitok(9) to declare code paths that assume they can sleep.
Currently only checks that we're not in an interrupt context, but will soon check that we're not holding any mutexes either. Update malloc(9) and pool(9) to use assertwaitok(9) as appropriate. "i like it" art@, oga@, marco@; "i see no harm" deraadt@; too trivial for me to bother prying actual oks from people.
Diffstat (limited to 'sys/kern/subr_pool.c')
-rw-r--r--sys/kern/subr_pool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c
index 4516c2c1bc9..5b9a354e423 100644
--- a/sys/kern/subr_pool.c
+++ b/sys/kern/subr_pool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_pool.c,v 1.96 2010/07/03 03:04:55 tedu Exp $ */
+/* $OpenBSD: subr_pool.c,v 1.97 2010/09/21 01:09:10 matthew Exp $ */
/* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */
/*-
@@ -455,7 +455,7 @@ pool_get(struct pool *pp, int flags)
#ifdef DIAGNOSTIC
if ((flags & PR_WAITOK) != 0)
- splassert(IPL_NONE);
+ assertwaitok();
#endif /* DIAGNOSTIC */
mtx_enter(&pp->pr_mtx);