SWI-Prolog Did You Know Did you know? SWI-Prolog has Multi-Thread support Search Documentation:
Predicate setup_call_catcher_cleanup/4