3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-11-29 08:49:51 +00:00
z3/src/util/scoped_ctrl_c.h
Nuno Lopes b1ab695eb6
fix #7603: race condition in Ctrl-C handling (#7755)
* fix #7603: race condition in Ctrl-C handling

* fix race in cancel_eh

* fix build
2025-08-06 14:27:28 -07:00

31 lines
499 B
C++

/*++
Copyright (c) 2011 Microsoft Corporation
Module Name:
scoped_ctrl_c.h
Abstract:
Scoped control-c handler.
Author:
Leonardo de Moura (leonardo) 2011-04-27.
Revision History:
--*/
#pragma once
#include "util/event_handler.h"
#include "util/util.h"
struct scoped_ctrl_c {
event_handler & m_cancel_eh;
bool m_enabled;
public:
// if enabled == false, then scoped_ctrl_c is a noop
scoped_ctrl_c(event_handler & eh, bool enabled = true);
~scoped_ctrl_c();
};