Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/kern/subr_pool.c,v retrieving revision 1.131.4.1 retrieving revision 1.132 diff -u -p -r1.131.4.1 -r1.132 --- src/sys/kern/subr_pool.c 2007/10/14 11:48:46 1.131.4.1 +++ src/sys/kern/subr_pool.c 2007/10/11 19:45:25 1.132 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_pool.c,v 1.131.4.1 2007/10/14 11:48:46 yamt Exp $ */ +/* $NetBSD: subr_pool.c,v 1.132 2007/10/11 19:45:25 ad Exp $ */ /*- * Copyright (c) 1997, 1999, 2000, 2002 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.131.4.1 2007/10/14 11:48:46 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.132 2007/10/11 19:45:25 ad Exp $"); #include "opt_pool.h" #include "opt_poollog.h" @@ -2353,6 +2353,8 @@ pool_allocator_alloc(struct pool *pp, in struct pool_allocator *pa = pp->pr_alloc; void *res; + LOCK_ASSERT(!simple_lock_held(&pp->pr_slock)); + res = (*pa->pa_alloc)(pp, flags); if (res == NULL && (flags & PR_WAITOK) == 0) { /* @@ -2373,6 +2375,8 @@ pool_allocator_free(struct pool *pp, voi { struct pool_allocator *pa = pp->pr_alloc; + LOCK_ASSERT(!simple_lock_held(&pp->pr_slock)); + (*pa->pa_free)(pp, v); }