allow processes to handle hard interrupts

no general purpose api at this time

closes #2904
This commit is contained in:
payonel 2018-09-08 11:39:30 -07:00
parent bf0fea1354
commit 7b77dba230
2 changed files with 4 additions and 2 deletions

View File

@ -65,7 +65,8 @@ process.list[init_thread] = {
vars={},
handles={},
io={}, --init will populate this
coroutine_handler = _coroutine
coroutine_handler = _coroutine,
signal = error
},
instances = setmetatable({}, {__mode="v"})
}

View File

@ -36,7 +36,8 @@ computer.pullSignal = function(...) -- dispatch
if interrupting then
lastInterrupt = current_time
if keyboard.isAltDown() then
error("interrupted", 0)
require("process").info().data.signal("interrupted", 0)
return
end
event.push("interrupted", current_time)
end