Skip to main content

luaur_vm/functions/
interrupt_thread.rs

1use crate::functions::lua_break::lua_break;
2use crate::functions::luau_callhook::luau_callhook;
3use crate::type_aliases::lua_state::lua_State;
4
5pub unsafe fn interrupt_thread(l: *mut lua_State, co: *mut lua_State) -> core::ffi::c_int {
6    let global = (*l).global;
7    let debuginterrupt = (*global).cb.debuginterrupt;
8    if debuginterrupt.is_some() {
9        luau_callhook(l, debuginterrupt, co as *mut core::ffi::c_void);
10    }
11
12    lua_break(l)
13}