]> Repositorios git - scryer-prolog.git/commit
Make sleep/1 interruptible by Ctrl-C
authorJavier Sagredo <[email protected]>
Wed, 17 Jun 2026 10:57:33 +0000 (12:57 +0200)
committerJavier Sagredo <[email protected]>
Wed, 17 Jun 2026 10:57:33 +0000 (12:57 +0200)
commit844f8e23474d698f41d8ba48a5bc788cd54b4735
tree2135fda295e70a555c6cf180bf3363921598c6b2
parent198dd5b7448f69ac689adffed1bc79567cb7912b
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