From acd336994c381c4a7c0f7571863863bd9df5fd75 Mon Sep 17 00:00:00 2001 From: Joe Hoyle Date: Wed, 19 Jul 2023 17:15:40 +0200 Subject: [PATCH] Add helper method to cancel VM interrupt (#260) Follow up to #257 --- src/zend/globals.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/zend/globals.rs b/src/zend/globals.rs index c9a7a0d91..8b7a21914 100644 --- a/src/zend/globals.rs +++ b/src/zend/globals.rs @@ -86,6 +86,19 @@ impl ExecutorGlobals { } } } + + /// Cancel a requested an interrupt of the PHP VM. + pub fn cancel_interrupt(&mut self) { + cfg_if::cfg_if! { + if #[cfg(php82)] { + unsafe { + zend_atomic_bool_store(&mut self.vm_interrupt, false); + } + } else { + self.vm_interrupt = true; + } + } + } } /// Executor globals rwlock.