From 5b8dc25eff2283ff9a42e45b37766ea87a36dc6d Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 17 Dec 2009 16:11:02 -0200 Subject: [PATCH] fix locking stuff. --- C/adtdefs.c | 1 + C/stdpreds.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/C/adtdefs.c b/C/adtdefs.c index cc695710e..f5d2b8793 100644 --- a/C/adtdefs.c +++ b/C/adtdefs.c @@ -440,6 +440,7 @@ Yap_HasOp(Atom a) while (!EndOfPAEntr(pp) && ( pp->KindOfPE != OpProperty)) pp = RepProp(pp->NextOfPE); + READ_UNLOCK(ae->ARWLock); if (EndOfPAEntr(pp)) { return FALSE; } else { diff --git a/C/stdpreds.c b/C/stdpreds.c index ca8b4afab..f56a661ad 100644 --- a/C/stdpreds.c +++ b/C/stdpreds.c @@ -2905,6 +2905,7 @@ cont_current_op(void) next = op->OpNext; if (Yap_unify_constant(ARG1,MkAtomTerm(op->OpName)) && unify_op(op)) { + READ_UNLOCK(op->OpRWLock); if (next) { EXTRA_CBACK_ARG(5,1) = (CELL) MkIntegerTerm((CELL)next); return TRUE; @@ -2912,6 +2913,7 @@ cont_current_op(void) cut_succeed(); } } else { + READ_UNLOCK(op->OpRWLock); if (next) { EXTRA_CBACK_ARG(5,1) = (CELL) MkIntegerTerm((CELL)next); return FALSE; @@ -2936,6 +2938,7 @@ cont_current_atom_op(void) READ_LOCK(op->OpRWLock); next = NextOp(RepOpProp(op->NextOfPE)); if (unify_op(op)) { + READ_UNLOCK(op->OpRWLock); if (next) { EXTRA_CBACK_ARG(5,1) = (CELL) MkIntegerTerm((CELL)next); return TRUE; @@ -2943,6 +2946,7 @@ cont_current_atom_op(void) cut_succeed(); } } else { + READ_UNLOCK(op->OpRWLock); if (next) { EXTRA_CBACK_ARG(5,1) = (CELL) MkIntegerTerm((CELL)next); return FALSE;