From aec49b06efd518437143ea082ebc3444b205f905 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Tue, 21 Sep 2010 01:09:11 +0000 Subject: 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. --- sys/kern/subr_pool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/kern/subr_pool.c') 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); -- cgit v1.2.3