From: Alex Hornung Date: Mon, 19 Apr 2010 16:39:16 +0000 (+0000) Subject: dsched - Periph.: call dsched_exit on thread exit X-Git-Tag: v2.7.3~100 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/f8abf63c2915f73cda605e7f5a04a6d2605f0733 dsched - Periph.: call dsched_exit on thread exit * The previous location of the call to dsched_exit was not right and did not allow the use of lockmgr. * We now call dsched_exit before the thread is completely killed and descheduled as to avoid any problems. --- diff --git a/sys/kern/lwkt_thread.c b/sys/kern/lwkt_thread.c index a8282e2ae2..97d8d74a28 100644 --- a/sys/kern/lwkt_thread.c +++ b/sys/kern/lwkt_thread.c @@ -1476,6 +1476,7 @@ lwkt_exit(void) if (td->td_flags & TDF_TSLEEPQ) tsleep_remove(td); biosched_done(td); + dsched_exit_thread(td); lwkt_deschedule_self(td); lwkt_remove_tdallq(td); if (td->td_flags & TDF_ALLOCATED_THREAD) @@ -1488,7 +1489,6 @@ lwkt_remove_tdallq(thread_t td) { KKASSERT(td->td_gd == mycpu); TAILQ_REMOVE(&td->td_gd->gd_tdallq, td, td_allq); - dsched_exit_thread(td); } void diff --git a/sys/platform/pc32/i386/vm_machdep.c b/sys/platform/pc32/i386/vm_machdep.c index 80d5d14cbd..5c35ba2674 100644 --- a/sys/platform/pc32/i386/vm_machdep.c +++ b/sys/platform/pc32/i386/vm_machdep.c @@ -57,6 +57,7 @@ #include #include #include +#include #include #include @@ -300,6 +301,7 @@ cpu_lwp_exit(void) } td->td_gd->gd_cnt.v_swtch++; + dsched_exit_thread(td); crit_enter_quick(td); if (td->td_flags & TDF_TSLEEPQ) tsleep_remove(td); diff --git a/sys/platform/pc64/x86_64/vm_machdep.c b/sys/platform/pc64/x86_64/vm_machdep.c index c02cb2d8c1..c74edb6cbe 100644 --- a/sys/platform/pc64/x86_64/vm_machdep.c +++ b/sys/platform/pc64/x86_64/vm_machdep.c @@ -53,6 +53,7 @@ #include #include #include +#include #include #include @@ -264,6 +265,7 @@ cpu_lwp_exit(void) } td->td_gd->gd_cnt.v_swtch++; + dsched_exit_thread(td); crit_enter_quick(td); if (td->td_flags & TDF_TSLEEPQ) tsleep_remove(td); diff --git a/sys/platform/vkernel/i386/vm_machdep.c b/sys/platform/vkernel/i386/vm_machdep.c index 54df1b5548..9bcca60c29 100644 --- a/sys/platform/vkernel/i386/vm_machdep.c +++ b/sys/platform/vkernel/i386/vm_machdep.c @@ -56,6 +56,7 @@ #include #include #include +#include #include #include @@ -301,6 +302,7 @@ cpu_lwp_exit(void) } td->td_gd->gd_cnt.v_swtch++; + dsched_exit_thread(td); crit_enter_quick(td); if (td->td_flags & TDF_TSLEEPQ) tsleep_remove(td); diff --git a/sys/platform/vkernel64/x86_64/vm_machdep.c b/sys/platform/vkernel64/x86_64/vm_machdep.c index 8673ebc356..b348472400 100644 --- a/sys/platform/vkernel64/x86_64/vm_machdep.c +++ b/sys/platform/vkernel64/x86_64/vm_machdep.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #include @@ -266,6 +267,7 @@ cpu_lwp_exit(void) } td->td_gd->gd_cnt.v_swtch++; + dsched_exit_thread(td); crit_enter_quick(td); lwkt_deschedule_self(td); lwkt_remove_tdallq(td);