[windows] re-call signal in sigint_handler for Windows

Summary:
Windows requires re-setting the signal handler each time it is used
and thus ctrl-c was not behaving properly on Windows

Reviewers: jfb

Differential Revision: https://reviews.llvm.org/D64046

llvm-svn: 365868
This commit is contained in:
Nathan Lanza 2019-07-12 04:43:46 +00:00
parent 5b9484e559
commit 320d6795b2

View File

@ -706,6 +706,9 @@ void sigwinch_handler(int signo) {
}
void sigint_handler(int signo) {
#ifdef _WIN32 // Restore handler as it is not persistent on Windows
signal(SIGINT, sigint_handler);
#endif
static std::atomic_flag g_interrupt_sent = ATOMIC_FLAG_INIT;
if (g_driver != nullptr) {
if (!g_interrupt_sent.test_and_set()) {