Hotfix for PX4 application not exiting anymore on Cygwin #11305
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hotfix for #11027
Test data / coverage
SITL on Cygwin (Wndows)
Describe problem solved by the proposed pull request
Some threads do not exit and are still running when trying to exit SITL running under Windows in Cygwin.
This problem was introduced with:
Describe your solution
I leave the SIGINT handler on its default implementation for Cygwin which kills the process and all its threads when pressing Ctrl+C.
This hotfix at least allows the usage of Ctrl+C again instead of forcing the user to use the task manager to shut down px4.exe going crazy on CPU load instead of exiting everytime.
Describe possible alternatives
An analysis of what exactly goes wrong when trying to exit gracefully would be the desired way but my limited experience with debugging the overly complex thread structure of PX4 through multiple wrapping layers and my already spent countless hours on this problem lead me to this hotfix.