fix interrupt enabling in call_setup and friends
remove between.
This commit is contained in:
parent
46543ccb5c
commit
a58e3d812d
15
pl/utils.yap
15
pl/utils.yap
@ -65,7 +65,7 @@ setup_call_cleanup(Setup, Goal, Cleanup) :-
|
|||||||
setup_call_catcher_cleanup(Setup, Goal, Catcher, Cleanup).
|
setup_call_catcher_cleanup(Setup, Goal, Catcher, Cleanup).
|
||||||
|
|
||||||
setup_call_catcher_cleanup(Setup, Goal, Catcher, Cleanup) :-
|
setup_call_catcher_cleanup(Setup, Goal, Catcher, Cleanup) :-
|
||||||
'$disable_interrupts',
|
yap_hacks:disable_interrupts,
|
||||||
'$do_setup'(Setup),
|
'$do_setup'(Setup),
|
||||||
catch('$safe_call_cleanup'(Goal,Cleanup,Catcher),
|
catch('$safe_call_cleanup'(Goal,Cleanup,Catcher),
|
||||||
Exception,
|
Exception,
|
||||||
@ -85,7 +85,7 @@ setup_call_catcher_cleanup(Setup, Goal, Catcher, Cleanup) :-
|
|||||||
(CP1 == CP0 -> ! ; true)
|
(CP1 == CP0 -> ! ; true)
|
||||||
;
|
;
|
||||||
% reenable interrupts if Setup failed
|
% reenable interrupts if Setup failed
|
||||||
'$enable_interrupts',
|
yap_hacks:enable_interrupts,
|
||||||
fail
|
fail
|
||||||
).
|
).
|
||||||
|
|
||||||
@ -102,8 +102,8 @@ setup_call_catcher_cleanup(Setup, Goal, Catcher, Cleanup) :-
|
|||||||
'$freeze_goal'(Catcher, '$clean_call'(Cleanup)),
|
'$freeze_goal'(Catcher, '$clean_call'(Cleanup)),
|
||||||
yap_hacks:trail_suspension_marker(Catcher),
|
yap_hacks:trail_suspension_marker(Catcher),
|
||||||
(
|
(
|
||||||
|
yap_hacks:enable_interrupts,
|
||||||
yap_hacks:current_choice_point(CP0),
|
yap_hacks:current_choice_point(CP0),
|
||||||
'$enable_interrupts',
|
|
||||||
'$execute'(Goal),
|
'$execute'(Goal),
|
||||||
yap_hacks:current_choice_point(CPF),
|
yap_hacks:current_choice_point(CPF),
|
||||||
(
|
(
|
||||||
@ -733,7 +733,7 @@ nth_instance(X,Y,Z) :-
|
|||||||
),
|
),
|
||||||
'$system_catch'('$query'(once(G), []),Module,Error,user:'$Error'(Error)).
|
'$system_catch'('$query'(once(G), []),Module,Error,user:'$Error'(Error)).
|
||||||
|
|
||||||
'$add_dot_to_atom_goal'([],[0'.]) :- !.
|
'$add_dot_to_atom_goal'([],[0'.]) :- !. %'
|
||||||
'$add_dot_to_atom_goal'([0'.],[0'.]) :- !.
|
'$add_dot_to_atom_goal'([0'.],[0'.]) :- !.
|
||||||
'$add_dot_to_atom_goal'([C|Gs0],[C|Gs]) :-
|
'$add_dot_to_atom_goal'([C|Gs0],[C|Gs]) :-
|
||||||
'$add_dot_to_atom_goal'(Gs0,Gs).
|
'$add_dot_to_atom_goal'(Gs0,Gs).
|
||||||
@ -749,10 +749,3 @@ nb_current(GlobalVariable, Val) :-
|
|||||||
nb_current(GlobalVariable, Val) :-
|
nb_current(GlobalVariable, Val) :-
|
||||||
nb_getval(GlobalVariable, Val).
|
nb_getval(GlobalVariable, Val).
|
||||||
|
|
||||||
|
|
||||||
between(I,M,I) :- I =< M.
|
|
||||||
between(I0,I,J) :- I0 < I,
|
|
||||||
I1 is I0+1,
|
|
||||||
between(I1,I,J).
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user