kernel - Fix lwp_fork/exit race
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 3 Aug 2016 05:28:54 +0000 (22:28 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 3 Aug 2016 05:31:36 +0000 (22:31 -0700)
commit987e141bd7f49edb03f000db9bb2bdc4d672b64d
tree4b83f8f223d515e587063ab28f62f5df04e53713
parent4161f66d193c22aaa9e8714572d118897ec4062c
kernel - Fix lwp_fork/exit race

* In a multi-threaded program it is possible for the exit sequence to
  deadlock if one thread is trying to exit (exit the entire process)
  while another thread is simultaniously creating a new thread.

* Fix the issue by having the new thread checking for the exit condition and
  sending a SIGKILL to itself.  And kprintf() a message when it happens.
sys/platform/pc64/x86_64/trap.c