mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-11 04:06:20 +00:00
[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:
parent
5b9484e559
commit
320d6795b2
@ -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()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user