From 09b62fa43dde6349fdba68f41492ca4ae35f5a5a Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Fri, 17 Jul 2009 17:55:52 -0700 Subject: [PATCH] tsleep_interlock() - Fix bug in cpu_lwp_exit(). * Fix a bug in cpu_lwp_exit() which could cause a TAILQ assertion due to a thread not being properly removed from the tsleep queue. --- sys/platform/pc32/i386/vm_machdep.c | 2 ++ sys/platform/pc64/amd64/vm_machdep.c | 2 ++ sys/platform/vkernel/i386/vm_machdep.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/sys/platform/pc32/i386/vm_machdep.c b/sys/platform/pc32/i386/vm_machdep.c index df2b7f695d..a698afc371 100644 --- a/sys/platform/pc32/i386/vm_machdep.c +++ b/sys/platform/pc32/i386/vm_machdep.c @@ -299,6 +299,8 @@ cpu_lwp_exit(void) td->td_gd->gd_cnt.v_swtch++; crit_enter_quick(td); + if (td->td_flags & TDF_TSLEEPQ) + tsleep_remove(td); lwkt_deschedule_self(td); lwkt_remove_tdallq(td); cpu_thread_exit(); diff --git a/sys/platform/pc64/amd64/vm_machdep.c b/sys/platform/pc64/amd64/vm_machdep.c index c774f7b10c..ae88aceb68 100644 --- a/sys/platform/pc64/amd64/vm_machdep.c +++ b/sys/platform/pc64/amd64/vm_machdep.c @@ -265,6 +265,8 @@ cpu_lwp_exit(void) td->td_gd->gd_cnt.v_swtch++; crit_enter_quick(td); + if (td->td_flags & TDF_TSLEEPQ) + tsleep_remove(td); lwkt_deschedule_self(td); lwkt_remove_tdallq(td); cpu_thread_exit(); diff --git a/sys/platform/vkernel/i386/vm_machdep.c b/sys/platform/vkernel/i386/vm_machdep.c index 6ed08d0611..d55563477e 100644 --- a/sys/platform/vkernel/i386/vm_machdep.c +++ b/sys/platform/vkernel/i386/vm_machdep.c @@ -300,6 +300,8 @@ cpu_lwp_exit(void) td->td_gd->gd_cnt.v_swtch++; crit_enter_quick(td); + if (td->td_flags & TDF_TSLEEPQ) + tsleep_remove(td); lwkt_deschedule_self(td); lwkt_remove_tdallq(td); cpu_thread_exit(); -- 2.41.0