fix backtracking in timeout.
This commit is contained in:
parent
56fa3499b1
commit
f9533c8757
@ -44,12 +44,24 @@ run_goal(Goal, Result0) :-
|
|||||||
% we can only enable interrupts after alarm was been enabled.
|
% we can only enable interrupts after alarm was been enabled.
|
||||||
yap_hacks:enable_interrupts,
|
yap_hacks:enable_interrupts,
|
||||||
Result0 = success,
|
Result0 = success,
|
||||||
|
yap_hacks:current_choice_point(CP0),
|
||||||
call(Goal),
|
call(Goal),
|
||||||
!,
|
yap_hacks:current_choice_point(CP1),
|
||||||
% make sure we're not getting an extraneous interrupt if we terminate early....
|
% make sure we're not getting an extraneous interrupt if we terminate early....
|
||||||
yap_hacks:disable_interrupts,
|
alarm(0,_,RT),
|
||||||
alarm(0,_,_),
|
(
|
||||||
true.
|
CP0 == CP1
|
||||||
|
->
|
||||||
|
true
|
||||||
|
;
|
||||||
|
(
|
||||||
|
true
|
||||||
|
;
|
||||||
|
alarm(RT,throw(time_out),_),
|
||||||
|
fail
|
||||||
|
)
|
||||||
|
).
|
||||||
|
|
||||||
run_goal(Goal, Result0) :-
|
run_goal(Goal, Result0) :-
|
||||||
yap_hacks:disable_interrupts,
|
yap_hacks:disable_interrupts,
|
||||||
% make sure we're not getting an extraneous interrupt if we terminate early....
|
% make sure we're not getting an extraneous interrupt if we terminate early....
|
||||||
|
Reference in New Issue
Block a user