git: kernel - Fix race in multi-LWP exit
dillon at crater.dragonflybsd.org
Mon Nov 28 22:20:02 PST 2011
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Mon Nov 28 22:13:38 2011 -0800
kernel - Fix race in multi-LWP exit
* Fix a very small race condition after TDF_EXITING could get set where a
LWPs thread could get destroyed by another cpu (reaping it) before
the thread actually finished exiting.
* Clean up a case where we were improperly testing TDF_RUNQ which could
result in unnecessary 1-tick delays in exit reaping.
* Beef up the assertion when TDF_EXITING is found to be set that
both TDF_RUNQ and TDF_TSLEEPQ are not set (before it was just checking
* Clean up reaplwp().
* Remove lwkt_wait_free()
* lwkt_free_thread() now waits for td_refs to drop to 0 before freeing
Summary of changes:
sys/kern/kern_exit.c | 62 +++++++++++++++++++++++++++++++----------------
sys/kern/lwkt_thread.c | 31 +++++++++++++-----------
2 files changed, 58 insertions(+), 35 deletions(-)
DragonFly BSD source repository
More information about the Commits