Add helper method to cancel VM interrupt (#260)

Follow up to #257
This commit is contained in:
Joe Hoyle 2023-07-19 17:15:40 +02:00 committed by GitHub
parent 42ef04a8ae
commit acd336994c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.