reset queue on close, so that it won;t be mistaken for an existing queue.
This commit is contained in:
parent
f1c9952c77
commit
37eae7b70a
@ -1638,8 +1638,8 @@ static Int p_nb_queue_close(USES_REGS1) {
|
|||||||
return Yap_unify(ARG3, ARG2);
|
return Yap_unify(ARG3, ARG2);
|
||||||
}
|
}
|
||||||
out = Yap_unify(ARG3, qp[QUEUE_TAIL]) && Yap_unify(ARG2, qp[QUEUE_HEAD]);
|
out = Yap_unify(ARG3, qp[QUEUE_TAIL]) && Yap_unify(ARG2, qp[QUEUE_HEAD]);
|
||||||
qp[-1] = (CELL)Yap_MkFunctor(AtomHeap, 1);
|
qp[QUEUE_HEAD] = qp[QUEUE_TAIL] = RESET_VARIABLE(qp + QUEUE_TAIL);
|
||||||
qp[QUEUE_ARENA] = qp[QUEUE_HEAD] = qp[QUEUE_TAIL] = MkIntegerTerm(0);
|
qp[QUEUE_SIZE] = MkIntTerm(0);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
Yap_Error(INSTANTIATION_ERROR, t, "queue/3");
|
Yap_Error(INSTANTIATION_ERROR, t, "queue/3");
|
||||||
|
Reference in New Issue
Block a user