Merge branch 'master' of gitosis@yap.dcc.fc.up.pt:yap-6
This commit is contained in:
commit
b127d0c248
2
C/exec.c
2
C/exec.c
@ -1497,9 +1497,9 @@ clean_trail(Term t, Term t0)
|
|||||||
} else {
|
} else {
|
||||||
Bind(pt, t);
|
Bind(pt, t);
|
||||||
Yap_WakeUp(pt);
|
Yap_WakeUp(pt);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
pt1--;
|
pt1--;
|
||||||
} else if (IsApplTerm(d1)) {
|
} else if (IsApplTerm(d1)) {
|
||||||
|
@ -1174,7 +1174,7 @@ p_nb_linkval(void)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
Term
|
||||||
Yap_SetGlobalVal(Atom at, Term t0)
|
Yap_SetGlobalVal(Atom at, Term t0)
|
||||||
{
|
{
|
||||||
Term to;
|
Term to;
|
||||||
|
27
C/sysbits.c
27
C/sysbits.c
@ -1563,6 +1563,24 @@ HandleALRM(int s)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined(_WIN32)
|
||||||
|
/* this routine is called if the system activated the alarm */
|
||||||
|
static RETSIGTYPE
|
||||||
|
#if (defined(__svr4__) || defined(__SVR4))
|
||||||
|
HandleVTALRM (int s, siginfo_t *x, ucontext_t *y)
|
||||||
|
#else
|
||||||
|
HandleVTALRM(int s)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
my_signal (SIGVTALRM, HandleVTALRM);
|
||||||
|
/* force the system to creep */
|
||||||
|
Yap_signal (YAP_VTALARM_SIGNAL);
|
||||||
|
/* now, say what is going on */
|
||||||
|
Yap_PutValue(AtomAlarm, MkAtomTerm(AtomTrue));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function is called after a normal interrupt had been caught.
|
* This function is called after a normal interrupt had been caught.
|
||||||
* It allows 6 possibilities: abort, continue, trace, debug, help, exit.
|
* It allows 6 possibilities: abort, continue, trace, debug, help, exit.
|
||||||
@ -1651,6 +1669,7 @@ InitSignals (void)
|
|||||||
my_signal (SIGUSR2, ReceiveSignal);
|
my_signal (SIGUSR2, ReceiveSignal);
|
||||||
my_signal (SIGHUP, ReceiveSignal);
|
my_signal (SIGHUP, ReceiveSignal);
|
||||||
my_signal (SIGALRM, HandleALRM);
|
my_signal (SIGALRM, HandleALRM);
|
||||||
|
my_signal (SIGVTALRM, HandleVTALRM);
|
||||||
#endif
|
#endif
|
||||||
#ifdef SIGPIPE
|
#ifdef SIGPIPE
|
||||||
my_signal (SIGPIPE, ReceiveSignal);
|
my_signal (SIGPIPE, ReceiveSignal);
|
||||||
@ -2779,6 +2798,11 @@ p_first_signal(void)
|
|||||||
UNLOCK(SignalLock);
|
UNLOCK(SignalLock);
|
||||||
return Yap_unify(ARG1, MkAtomTerm(AtomSigAlarm));
|
return Yap_unify(ARG1, MkAtomTerm(AtomSigAlarm));
|
||||||
}
|
}
|
||||||
|
if (ActiveSignals & YAP_VTALARM_SIGNAL) {
|
||||||
|
ActiveSignals &= ~YAP_VTALARM_SIGNAL;
|
||||||
|
UNLOCK(SignalLock);
|
||||||
|
return Yap_unify(ARG1, MkAtomTerm(AtomSigVTAlarm));
|
||||||
|
}
|
||||||
if (ActiveSignals & YAP_DELAY_CREEP_SIGNAL) {
|
if (ActiveSignals & YAP_DELAY_CREEP_SIGNAL) {
|
||||||
ActiveSignals &= ~(YAP_CREEP_SIGNAL|YAP_DELAY_CREEP_SIGNAL);
|
ActiveSignals &= ~(YAP_CREEP_SIGNAL|YAP_DELAY_CREEP_SIGNAL);
|
||||||
#ifdef THREADS
|
#ifdef THREADS
|
||||||
@ -2864,6 +2888,9 @@ p_continue_signals(void)
|
|||||||
if (ActiveSignals & YAP_ALARM_SIGNAL) {
|
if (ActiveSignals & YAP_ALARM_SIGNAL) {
|
||||||
Yap_signal(YAP_ALARM_SIGNAL);
|
Yap_signal(YAP_ALARM_SIGNAL);
|
||||||
}
|
}
|
||||||
|
if (ActiveSignals & YAP_VTALARM_SIGNAL) {
|
||||||
|
Yap_signal(YAP_VTALARM_SIGNAL);
|
||||||
|
}
|
||||||
if (ActiveSignals & YAP_CREEP_SIGNAL) {
|
if (ActiveSignals & YAP_CREEP_SIGNAL) {
|
||||||
Yap_signal(YAP_CREEP_SIGNAL);
|
Yap_signal(YAP_CREEP_SIGNAL);
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ static void
|
|||||||
wrputs(char *s, wrf writewch) /* writes a string */
|
wrputs(char *s, wrf writewch) /* writes a string */
|
||||||
{
|
{
|
||||||
while (*s) {
|
while (*s) {
|
||||||
wrputc(*s++, writewch);
|
wrputc((unsigned char)(*s++), writewch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
H/Yap.h
3
H/Yap.h
@ -578,7 +578,8 @@ typedef enum
|
|||||||
YAP_STATISTICS_SIGNAL = 0x8000, /* received statistics */
|
YAP_STATISTICS_SIGNAL = 0x8000, /* received statistics */
|
||||||
YAP_DELAY_CREEP_SIGNAL = 0x10000, /* received a creep but should not do it */
|
YAP_DELAY_CREEP_SIGNAL = 0x10000, /* received a creep but should not do it */
|
||||||
YAP_AGC_SIGNAL = 0x20000, /* call atom garbage collector asap */
|
YAP_AGC_SIGNAL = 0x20000, /* call atom garbage collector asap */
|
||||||
YAP_PIPE_SIGNAL = 0x40000 /* call atom garbage collector asap */
|
YAP_PIPE_SIGNAL = 0x40000, /* call atom garbage collector asap */
|
||||||
|
YAP_VTALARM_SIGNAL = 0x80000 /* received SIGVTALARM */
|
||||||
} yap_signals;
|
} yap_signals;
|
||||||
|
|
||||||
#define NUMBER_OF_YAP_FLAGS LAST_FLAG
|
#define NUMBER_OF_YAP_FLAGS LAST_FLAG
|
||||||
|
@ -188,7 +188,7 @@ void STD_PROTO(Yap_inform_profiler_of_clause,(struct yami *,struct yami *,struct
|
|||||||
/* globals.c */
|
/* globals.c */
|
||||||
Term STD_PROTO(Yap_NewArena,(UInt,CELL *));
|
Term STD_PROTO(Yap_NewArena,(UInt,CELL *));
|
||||||
void STD_PROTO(Yap_InitGlobals,(void));
|
void STD_PROTO(Yap_InitGlobals,(void));
|
||||||
int STD_PROTO(Yap_SetGlobalVal, (Atom, Term));
|
Term STD_PROTO(Yap_SetGlobalVal, (Atom, Term));
|
||||||
void STD_PROTO(Yap_AllocateDefaultArena, (Int, Int));
|
void STD_PROTO(Yap_AllocateDefaultArena, (Int, Int));
|
||||||
|
|
||||||
/* grow.c */
|
/* grow.c */
|
||||||
|
@ -238,6 +238,7 @@
|
|||||||
AtomSigTrace = Yap_LookupAtom("sig_trace");
|
AtomSigTrace = Yap_LookupAtom("sig_trace");
|
||||||
AtomSigUsr1 = Yap_LookupAtom("sig_usr1");
|
AtomSigUsr1 = Yap_LookupAtom("sig_usr1");
|
||||||
AtomSigUsr2 = Yap_LookupAtom("sig_usr2");
|
AtomSigUsr2 = Yap_LookupAtom("sig_usr2");
|
||||||
|
AtomSigVTAlarm = Yap_LookupAtom("sig_vtalarm");
|
||||||
AtomSigWakeUp = Yap_LookupAtom("sig_wake_up");
|
AtomSigWakeUp = Yap_LookupAtom("sig_wake_up");
|
||||||
AtomSlash = Yap_LookupAtom("/");
|
AtomSlash = Yap_LookupAtom("/");
|
||||||
AtomSocket = Yap_LookupAtom("socket");
|
AtomSocket = Yap_LookupAtom("socket");
|
||||||
|
@ -240,6 +240,7 @@
|
|||||||
AtomSigTrace = AtomAdjust(AtomSigTrace);
|
AtomSigTrace = AtomAdjust(AtomSigTrace);
|
||||||
AtomSigUsr1 = AtomAdjust(AtomSigUsr1);
|
AtomSigUsr1 = AtomAdjust(AtomSigUsr1);
|
||||||
AtomSigUsr2 = AtomAdjust(AtomSigUsr2);
|
AtomSigUsr2 = AtomAdjust(AtomSigUsr2);
|
||||||
|
AtomSigVTAlarm = AtomAdjust(AtomSigVTAlarm);
|
||||||
AtomSigWakeUp = AtomAdjust(AtomSigWakeUp);
|
AtomSigWakeUp = AtomAdjust(AtomSigWakeUp);
|
||||||
AtomSlash = AtomAdjust(AtomSlash);
|
AtomSlash = AtomAdjust(AtomSlash);
|
||||||
AtomSocket = AtomAdjust(AtomSocket);
|
AtomSocket = AtomAdjust(AtomSocket);
|
||||||
|
@ -482,6 +482,8 @@
|
|||||||
#define AtomSigUsr1 Yap_heap_regs->AtomSigUsr1_
|
#define AtomSigUsr1 Yap_heap_regs->AtomSigUsr1_
|
||||||
Atom AtomSigUsr2_;
|
Atom AtomSigUsr2_;
|
||||||
#define AtomSigUsr2 Yap_heap_regs->AtomSigUsr2_
|
#define AtomSigUsr2 Yap_heap_regs->AtomSigUsr2_
|
||||||
|
Atom AtomSigVTAlarm_;
|
||||||
|
#define AtomSigVTAlarm Yap_heap_regs->AtomSigVTAlarm_
|
||||||
Atom AtomSigWakeUp_;
|
Atom AtomSigWakeUp_;
|
||||||
#define AtomSigWakeUp Yap_heap_regs->AtomSigWakeUp_
|
#define AtomSigWakeUp Yap_heap_regs->AtomSigWakeUp_
|
||||||
Atom AtomSlash_;
|
Atom AtomSlash_;
|
||||||
|
@ -39,13 +39,13 @@ run_formats([Com-Args|StackInfo], Stream) :-
|
|||||||
virtual_alarm(Interval, Goal, Left) :-
|
virtual_alarm(Interval, Goal, Left) :-
|
||||||
Interval == 0, !,
|
Interval == 0, !,
|
||||||
virtual_alarm(0, 0, Left0, _),
|
virtual_alarm(0, 0, Left0, _),
|
||||||
on_signal(sig_alarm, _, Goal),
|
on_signal(sig_vtalarm, _, Goal),
|
||||||
Left = Left0.
|
Left = Left0.
|
||||||
virtual_alarm(Interval, Goal, Left) :-
|
virtual_alarm(Interval, Goal, Left) :-
|
||||||
integer(Interval), !,
|
integer(Interval), !,
|
||||||
on_signal(sig_alarm, _, Goal),
|
on_signal(sig_vtalarm, _, Goal),
|
||||||
virtual_alarm(Interval, 0, Left, _).
|
virtual_alarm(Interval, 0, Left, _).
|
||||||
virtual_alarm(Interval.USecs, Goal, Left.LUSecs) :-
|
virtual_alarm(Interval.USecs, Goal, Left.LUSecs) :-
|
||||||
on_signal(sig_alarm, _, Goal),
|
on_signal(sig_vtalarm, _, Goal),
|
||||||
virtual_alarm(Interval, USecs, Left, LUSecs).
|
virtual_alarm(Interval, USecs, Left, LUSecs).
|
||||||
|
|
||||||
|
@ -249,6 +249,7 @@ A SigStatistics N "sig_statistic"
|
|||||||
A SigTrace N "sig_trace"
|
A SigTrace N "sig_trace"
|
||||||
A SigUsr1 N "sig_usr1"
|
A SigUsr1 N "sig_usr1"
|
||||||
A SigUsr2 N "sig_usr2"
|
A SigUsr2 N "sig_usr2"
|
||||||
|
A SigVTAlarm N "sig_vtalarm"
|
||||||
A SigWakeUp N "sig_wake_up"
|
A SigWakeUp N "sig_wake_up"
|
||||||
A Slash N "/"
|
A Slash N "/"
|
||||||
A Socket N "socket"
|
A Socket N "socket"
|
||||||
|
@ -316,7 +316,7 @@ domain_error(mutable, Opt) --> !,
|
|||||||
[ 'invalid id mutable ~w' - [Opt] ].
|
[ 'invalid id mutable ~w' - [Opt] ].
|
||||||
domain_error(module_decl_options, Opt) --> !,
|
domain_error(module_decl_options, Opt) --> !,
|
||||||
[ 'expect module declaration options, found ~w' - [Opt] ].
|
[ 'expect module declaration options, found ~w' - [Opt] ].
|
||||||
domain_error(not_empty_list, Opt) --> !,
|
domain_error(non_empty_list, Opt) --> !,
|
||||||
[ 'found empty list' - [Opt] ].
|
[ 'found empty list' - [Opt] ].
|
||||||
domain_error(not_less_than_zero, Opt) --> !,
|
domain_error(not_less_than_zero, Opt) --> !,
|
||||||
[ 'number ~w less than zero' - [Opt] ].
|
[ 'number ~w less than zero' - [Opt] ].
|
||||||
|
@ -96,6 +96,8 @@
|
|||||||
% Unix signals
|
% Unix signals
|
||||||
'$do_signal'(sig_alarm, G) :-
|
'$do_signal'(sig_alarm, G) :-
|
||||||
'$signal_handler'(sig_alarm, G).
|
'$signal_handler'(sig_alarm, G).
|
||||||
|
'$do_signal'(sig_vtalarm, G) :-
|
||||||
|
'$signal_handler'(sig_vtalarm, G).
|
||||||
'$do_signal'(sig_hup, G) :-
|
'$do_signal'(sig_hup, G) :-
|
||||||
'$signal_handler'(sig_hup, G).
|
'$signal_handler'(sig_hup, G).
|
||||||
'$do_signal'(sig_usr1, G) :-
|
'$do_signal'(sig_usr1, G) :-
|
||||||
|
Reference in New Issue
Block a user