From c781f51ecf4509165098ae5047e861412f01ba92 Mon Sep 17 00:00:00 2001 From: dimitr Date: Sun, 8 Apr 2012 05:57:12 +0000 Subject: [PATCH] Rolled back the optimization committed recently due to the found regressions. A better solution is researched. --- src/jrd/Database.cpp | 8 +------- src/jrd/Database.h | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/jrd/Database.cpp b/src/jrd/Database.cpp index 2ca189d26b..99631b3ace 100644 --- a/src/jrd/Database.cpp +++ b/src/jrd/Database.cpp @@ -155,18 +155,13 @@ namespace Jrd lock->lck_object = counter; LCK_lock(tdbb, lock, LCK_PW, LCK_WAIT); - counter->isProtected = true; counter->curVal = 1; counter->maxVal = 0; } if (counter->curVal > counter->maxVal) { - if (!counter->isProtected) - { - LCK_convert(tdbb, counter->lock, LCK_PW, LCK_WAIT); - counter->isProtected = true; - } + LCK_convert(tdbb, counter->lock, LCK_PW, LCK_WAIT); counter->curVal = LCK_read_data(tdbb, counter->lock); @@ -201,7 +196,6 @@ namespace Jrd Jrd::ContextPoolHolder context(tdbb, dbb->dbb_permanent); LCK_downgrade(tdbb, counter->lock); - counter->isProtected = false; } catch (const Firebird::Exception&) {} // no-op diff --git a/src/jrd/Database.h b/src/jrd/Database.h index cfefbe6a31..b35e72703b 100644 --- a/src/jrd/Database.h +++ b/src/jrd/Database.h @@ -287,7 +287,6 @@ public: struct ValueCache { Lock* lock; - bool isProtected; SLONG curVal; SLONG maxVal; };