This refactors and fixes the entirety of waitpid. This started with fixing a backgrounding bug, but it revealed bugs elsewhere in waitpid when the pid is specified (it would formerly return if any cage had finished.
This refactors all of this to rely on the zombies list, which holds any cage that has exited. It also makes the mutex/CV scheme much more straightforward.
This refactors and fixes the entirety of waitpid. This started with fixing a backgrounding bug, but it revealed bugs elsewhere in waitpid when the pid is specified (it would formerly return if any cage had finished.
This refactors all of this to rely on the zombies list, which holds any cage that has exited. It also makes the mutex/CV scheme much more straightforward.