When user press Ctrl+c, it'll send an interrupt signal to program and the default behavior is exiting the program. This commit adds an interrupt signal handler. When user press Ctrl+c, the handler sets a global variable to let each thread know it's about exiting. If something stuck there, user can press Ctrl+c again and it'll exit program immediately.
Once we can exit program gracefully, we can use valgrid to do some tests like memory leak.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
When user press Ctrl+c, it'll send an interrupt signal to program and the default behavior is exiting the program. This commit adds an interrupt signal handler. When user press Ctrl+c, the handler sets a global variable to let each thread know it's about exiting. If something stuck there, user can press Ctrl+c again and it'll exit program immediately.
Once we can exit program gracefully, we can use valgrid to do some tests like memory leak.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.