Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-3]: src/sys/kern Pull up revision 1.150 (requested by yamt in tic...
details: https://anonhg.NetBSD.org/src/rev/bf012ee9d6fa
branches: netbsd-3
changeset: 577010:bf012ee9d6fa
user: tron <tron%NetBSD.org@localhost>
date: Sun Aug 21 22:06:14 2005 +0000
description:
Pull up revision 1.150 (requested by yamt in ticket #679):
exit_lwps: fix a race with eg. sa_setwoken.
ie. "exit_lwps: lwp_wait1 failed with error 11"
PR/30689.
diffstat:
sys/kern/kern_exit.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diffs (41 lines):
diff -r 3ad7293ef406 -r bf012ee9d6fa sys/kern/kern_exit.c
--- a/sys/kern/kern_exit.c Sun Aug 21 22:04:22 2005 +0000
+++ b/sys/kern/kern_exit.c Sun Aug 21 22:06:14 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_exit.c,v 1.145.2.1 2005/08/21 22:04:22 tron Exp $ */
+/* $NetBSD: kern_exit.c,v 1.145.2.2 2005/08/21 22:06:14 tron Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.145.2.1 2005/08/21 22:04:22 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.145.2.2 2005/08/21 22:06:14 tron Exp $");
#include "opt_ktrace.h"
#include "opt_perfctrs.h"
@@ -590,6 +590,7 @@
}
}
+retry:
/*
* Interrupt LWPs in interruptable sleep, unsuspend suspended
* LWPs, make detached LWPs undetached (so we can wait for
@@ -613,6 +614,14 @@
DPRINTF(("exit_lwps: waiting for %d LWPs (%d runnable, %d zombies)\n",
p->p_nlwps, p->p_nrlwps, p->p_nzlwps));
error = lwp_wait1(l, 0, &waited, LWPWAIT_EXITCONTROL);
+ if (error == EDEADLK) {
+ /*
+ * LWPs can get suspended/slept behind us.
+ * (eg. sa_setwoken)
+ * kick them again and retry.
+ */
+ goto retry;
+ }
if (error)
panic("exit_lwps: lwp_wait1 failed with error %d\n",
error);
Home |
Main Index |
Thread Index |
Old Index