parent
2b495cd095
commit
c1dcb1d75d
@ -211,6 +211,10 @@ on_signal(Signal,OldAction,default) :-
|
|||||||
'$reset_signal'(Signal, OldAction).
|
'$reset_signal'(Signal, OldAction).
|
||||||
on_signal(Signal,OldAction,Action) :-
|
on_signal(Signal,OldAction,Action) :-
|
||||||
var(Action), !,
|
var(Action), !,
|
||||||
|
throw(error(system_error,'Somehow the meta_predicate declarations of on_signal are subverted!')).
|
||||||
|
on_signal(Signal,OldAction,Action) :-
|
||||||
|
Action = (_:Goal),
|
||||||
|
var(Goal), !,
|
||||||
'$check_signal'(Signal, OldAction),
|
'$check_signal'(Signal, OldAction),
|
||||||
Action = OldAction.
|
Action = OldAction.
|
||||||
on_signal(Signal,OldAction,Action) :-
|
on_signal(Signal,OldAction,Action) :-
|
||||||
@ -234,6 +238,10 @@ on_signal(Signal,OldAction,Action) :-
|
|||||||
'$check_signal'(_, default).
|
'$check_signal'(_, default).
|
||||||
|
|
||||||
|
|
||||||
|
alarm(Interval, Goal, Left) :-
|
||||||
|
Interval == 0, !,
|
||||||
|
on_signal(sig_alarm, _, Goal),
|
||||||
|
'$alarm'(Interval, 0, Left, _).
|
||||||
alarm(Interval, Goal, Left) :-
|
alarm(Interval, Goal, Left) :-
|
||||||
integer(Interval), !,
|
integer(Interval), !,
|
||||||
on_signal(sig_alarm, _, Goal),
|
on_signal(sig_alarm, _, Goal),
|
||||||
|
Reference in New Issue
Block a user