mirror of
https://github.com/Z3Prover/z3
synced 2025-08-02 01:13:18 +00:00
ensure that timeouts are distinguished from other cancel events #848
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
7d8c745c89
commit
7a977f0106
10 changed files with 55 additions and 10 deletions
|
@ -31,10 +31,14 @@ class cancel_eh : public event_handler {
|
|||
public:
|
||||
cancel_eh(T & o): m_canceled(false), m_obj(o) {}
|
||||
~cancel_eh() { if (m_canceled) m_obj.dec_cancel(); }
|
||||
virtual void operator()() {
|
||||
m_canceled = true;
|
||||
m_obj.inc_cancel();
|
||||
virtual void operator()(event_handler_caller_t caller_id) {
|
||||
if (!m_canceled) {
|
||||
m_caller_id = caller_id;
|
||||
m_canceled = true;
|
||||
m_obj.inc_cancel();
|
||||
}
|
||||
}
|
||||
bool canceled() const { return m_canceled; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue