make sure we reset global variables when exiting a thread
This commit is contained in:
@@ -106,6 +106,7 @@ static void
|
||||
kill_thread_engine (int wid, int always_die)
|
||||
{
|
||||
Prop p0 = AbsPredProp(Yap_heap_regs->thread_handle[wid].local_preds);
|
||||
GlobalEntry *gl = GlobalVariables;
|
||||
|
||||
/* kill all thread local preds */
|
||||
while(p0) {
|
||||
@@ -114,6 +115,10 @@ kill_thread_engine (int wid, int always_die)
|
||||
Yap_Abolish(ap);
|
||||
Yap_FreeCodeSpace((char *)ap);
|
||||
}
|
||||
while (gl) {
|
||||
gl->global = TermFoundVar;
|
||||
gl = gl->NextGE;
|
||||
}
|
||||
Yap_KillStacks(wid);
|
||||
Yap_heap_regs->wl[wid].active_signals = 0L;
|
||||
free(Yap_heap_regs->wl[wid].scratchpad.ptr);
|
||||
|
||||
Reference in New Issue
Block a user