From 4da6cdf9f6f1c801e26c450104ff25b04b140335 Mon Sep 17 00:00:00 2001 From: cl Date: Tue, 25 Nov 2003 10:05:17 +0000 Subject: [PATCH] Fix check for pending upcalls after we return stacks. Noted by yamt@. --- sys/kern/kern_sa.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_sa.c b/sys/kern/kern_sa.c index 266492505e7c..63bddc55dc5a 100644 --- a/sys/kern/kern_sa.c +++ b/sys/kern/kern_sa.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_sa.c,v 1.44 2003/11/17 22:57:52 cl Exp $ */ +/* $NetBSD: kern_sa.c,v 1.45 2003/11/25 10:05:17 cl Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_sa.c,v 1.44 2003/11/17 22:57:52 cl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_sa.c,v 1.45 2003/11/25 10:05:17 cl Exp $"); #include #include @@ -276,7 +276,11 @@ sys_sa_stacks(struct lwp *l, void *v, register_t *retval) SLIST_INSERT_HEAD(&sa->sa_stackslist, sast, sast_list); } - if (SLIST_EMPTY(&sa->sa_stackslist) && (sa->sa_wokenq_head != NULL)) + /* + * Check if there are any pending upcalls we didn't make + * because there were not enough stacks. + */ + if (sa->sa_wokenq_head != NULL) l->l_flag |= L_SA_UPCALL; SA_LWP_STATE_UNLOCK(l, f);