-
Ingo Molnar authored
This fixes all known signal semantics problems. sigwait() is really evil - i had to re-introduce ->real_blocked. When a signal has no handler defined then the actual action taken by the kernel depends on whether the sigwait()-ing thread was blocking the signal originally or not. If the signal was blocked => specific delivery to the thread, if the signal was not blocked => kill-all. fortunately this meant that PF_SIGWAIT could be killed - the real_blocked field contains all the necessery information to do the right decision at signal-sending time. i've also cleaned up and made the shared-pending code more robust: now there's a single central dequeue_signal() function that handles all the details. Plus upon unqueueing a shared-pending signal we now re-queue the signal to the current thread, which this time around is not going to end up in the shared-pending queue. This change handles the following case correctly: a signal was blocked in every signal, then one thread unblocks it and gets the signal delivered - but there's no handler for the signal => the correct action is to do a kill-all. i removed the unused shared_unblocked field as well, reported by Oleg Nesterov. now we pass both signal-tst1 and signal-tst2, so i'm confident that we got most of the details right.
794aa320