Stop all processes and clear notification queues when disabling non-stop
mode. Ensure that no stop notifications are sent for processes stopped
due to the mode switch.
Sponsored by: The FreeBSD Foundation
Differential D128893
[lldb] [llgs] Fix disabling non-stop mode mgorny on Jun 30 2022, 1:50 AM. Authored by
Details Stop all processes and clear notification queues when disabling non-stop Sponsored by: The FreeBSD Foundation
Diff Detail
Event TimelineComment Actions FYI, I don't feel very strongly about this. If you really dislike adding m_inhibit_stop_reason_processes, I suppose we could alternatively just declare disabling non-stop as unsupported and error out. Comment Actions The problem is I "really disliked" the vKill part as well. I didn't want to make a big deal out of it, as I though it was an isolated use case, but now it seems like this may be a regular occurrence. I think things would look better if we at least grouped all of the various bits of information about a single process. So, instead of three maps, we would have a single map, whose values would contain the process pointer, and any other state data we need. That could be a flag (whether the process is being killed), or maybe a callback (specifying the action to perform when the process stops). WDYT?
Comment Actions Actually, on second thought (:D) do we even need a per-process flag for this? Turning off non-stop should stop _all_ processes, so instead of checking whether there are any processes with the 'stopping-due-to-qnonstop` flag around, couldn't we just check if we have any unstopped processes altogether? (This will require a global qnonstop-in-progress flag, but that's still better than a per-process flag.) Comment Actions Use a single bool member to indicate whether we're still waiting for any process to stop. Turned out pretty easy. |
if (m_inhibit_stop_reason_processes.erase(process.GetID()) != 0)