From c6859911190f744f2f133c1d00d5fb67cfcec77d Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 16 Apr 2009 12:55:47 -0500 Subject: [PATCH] fix self-deadlock in empty IDB entries. --- C/dbase.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/C/dbase.c b/C/dbase.c index 594d711b9..c58eec95f 100644 --- a/C/dbase.c +++ b/C/dbase.c @@ -3449,6 +3449,13 @@ lu_recorded(PredEntry *pe) { YENV[E_CB] = (CELL) B; } P = pe->CodeOfPred; +#if defined(YAPOR) || defined(THREADS) + /* avoid holding a lock if we don't have anything in the database */ + if (P == FAILCODE) { + UNLOCK(pe->PELock); + PP = NULL; + } +#endif } if (pe->PredFlags & ProfiledPredFlag) { LOCK(pe->StatisticsForPred.lock);