]> Repositorios git - scryer-prolog.git/commit
Make sleep/1 interruptible by Ctrl-C
authorJavier Sagredo <[email protected]>
Wed, 17 Jun 2026 21:58:29 +0000 (23:58 +0200)
committerJavier Sagredo <[email protected]>
Wed, 17 Jun 2026 21:58:29 +0000 (23:58 +0200)
commit7816f95894abcf760e24247a5a066fda462a0cc1
tree7e7434b4d7b4fda7526d8473cbd26c3900cdbfa7
parentdaaab1cb3738c13274b5ad82a1047639bc13bc36
Make sleep/1 interruptible by Ctrl-C

sleep/1 previously called a single blocking std::thread::sleep for the
whole duration, which runs to completion regardless of SIGINT. The
interrupt flag was only polled by the dispatch loop every 256
instructions, so a sleep-dominated loop kept running for a
nondeterministic number of extra iterations after Ctrl-C.

Sleep in 50ms slices and poll interrupt_occured() between them, throwing
the interrupt exception promptly when the flag is set.
src/machine/dispatch.rs
src/machine/system_calls.rs