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:28:54 +0000 (22:28 -0700)
commitae1f1544c90b64f747ee70562f8c71101ff3603a
treeac53d6e2d23581119c544a6108290d367582609c
parenta1df193df2a1658996f09ad6bd0f7fd69bc71fa6
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