make consult_level a local variable
assert() within consult should act as a normal assert.
This commit is contained in:
parent
f49459fcfc
commit
c940245182
@ -2507,6 +2507,8 @@ p_compile_dynamic( USES_REGS1 )
|
|||||||
if (RepAtom(AtomOfTerm(t1))->StrOfAE[0] == 'f') mode = asserta;
|
if (RepAtom(AtomOfTerm(t1))->StrOfAE[0] == 'f') mode = asserta;
|
||||||
else mode = assertz;
|
else mode = assertz;
|
||||||
} else mode = IntegerOfTerm(t1);
|
} else mode = IntegerOfTerm(t1);
|
||||||
|
if (mode == assertz && consult_level)
|
||||||
|
mode = consult;
|
||||||
old_optimize = optimizer_on;
|
old_optimize = optimizer_on;
|
||||||
optimizer_on = FALSE;
|
optimizer_on = FALSE;
|
||||||
YAPEnterCriticalSection();
|
YAPEnterCriticalSection();
|
||||||
@ -2530,8 +2532,6 @@ p_compile_dynamic( USES_REGS1 )
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int consult_level = 0;
|
|
||||||
|
|
||||||
static Atom
|
static Atom
|
||||||
YapConsultingFile ( USES_REGS1 )
|
YapConsultingFile ( USES_REGS1 )
|
||||||
{
|
{
|
||||||
|
@ -81,6 +81,7 @@
|
|||||||
#if LOW_LEVEL_TRACER
|
#if LOW_LEVEL_TRACER
|
||||||
#define Yap_total_choicepoints WL->total_cps
|
#define Yap_total_choicepoints WL->total_cps
|
||||||
#endif
|
#endif
|
||||||
|
#define consult_level WL->consult_level_
|
||||||
|
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
#define SignalLock WL->signal_lock
|
#define SignalLock WL->signal_lock
|
||||||
@ -134,7 +135,7 @@
|
|||||||
#define PL_local_data_p WL->Yap_ld_
|
#define PL_local_data_p WL->Yap_ld_
|
||||||
#define execution WL->_execution
|
#define execution WL->_execution
|
||||||
|
|
||||||
#if (defined(YAPOR) || defined(TABLING)) && defined(THREADS)
|
#if MULTIPLE_STACKS
|
||||||
#define WORKER WL->worker
|
#define WORKER WL->worker
|
||||||
#endif
|
#endif
|
||||||
#ifdef THREADS
|
#ifdef THREADS
|
||||||
|
@ -83,6 +83,7 @@ typedef struct worker_local {
|
|||||||
#if LOW_LEVEL_TRACER
|
#if LOW_LEVEL_TRACER
|
||||||
Int total_cps;
|
Int total_cps;
|
||||||
#endif
|
#endif
|
||||||
|
int consult_level_;
|
||||||
|
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
lockvar signal_lock;
|
lockvar signal_lock;
|
||||||
@ -136,7 +137,7 @@ typedef struct worker_local {
|
|||||||
struct PL_local_data *Yap_ld_;
|
struct PL_local_data *Yap_ld_;
|
||||||
struct open_query_struct* _execution;
|
struct open_query_struct* _execution;
|
||||||
|
|
||||||
#if (defined(YAPOR) || defined(TABLING)) && defined(THREADS)
|
#if MULTIPLE_STACKS
|
||||||
struct worker worker;
|
struct worker worker;
|
||||||
#endif
|
#endif
|
||||||
#ifdef THREADS
|
#ifdef THREADS
|
||||||
|
@ -81,6 +81,7 @@ static void InitWorker(int wid) {
|
|||||||
#if LOW_LEVEL_TRACER
|
#if LOW_LEVEL_TRACER
|
||||||
FOREIGN(wid)->total_cps = 0;
|
FOREIGN(wid)->total_cps = 0;
|
||||||
#endif
|
#endif
|
||||||
|
FOREIGN(wid)->consult_level_ = 0;
|
||||||
|
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
INIT_LOCK(FOREIGN(wid)->signal_lock);
|
INIT_LOCK(FOREIGN(wid)->signal_lock);
|
||||||
@ -134,7 +135,7 @@ static void InitWorker(int wid) {
|
|||||||
FOREIGN(wid)->Yap_ld_ = Yap_InitThreadIO(wid);
|
FOREIGN(wid)->Yap_ld_ = Yap_InitThreadIO(wid);
|
||||||
FOREIGN(wid)->_execution = NULL;
|
FOREIGN(wid)->_execution = NULL;
|
||||||
|
|
||||||
#if (defined(YAPOR) || defined(TABLING)) && defined(THREADS)
|
#if MULTIPLE_STACKS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef THREADS
|
#ifdef THREADS
|
||||||
|
@ -82,6 +82,7 @@ static void RestoreWorker(int wid USES_REGS) {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
REINIT_LOCK(FOREIGN(wid)->signal_lock);
|
REINIT_LOCK(FOREIGN(wid)->signal_lock);
|
||||||
|
|
||||||
@ -134,7 +135,7 @@ static void RestoreWorker(int wid USES_REGS) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if (defined(YAPOR) || defined(TABLING)) && defined(THREADS)
|
#if MULTIPLE_STACKS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef THREADS
|
#ifdef THREADS
|
||||||
|
@ -89,6 +89,8 @@ Int last_ss_time LastSSTime =0L
|
|||||||
Int total_cps Yap_total_choicepoints =0
|
Int total_cps Yap_total_choicepoints =0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int consult_level_ consult_level =0
|
||||||
|
|
||||||
// global variables that cannot be global in a thread/or-p implementation
|
// global variables that cannot be global in a thread/or-p implementation
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
lockvar signal_lock SignalLock MkLock
|
lockvar signal_lock SignalLock MkLock
|
||||||
|
Reference in New Issue
Block a user