From 9755df067e8f267d4d8f02bfad519360b42b548b Mon Sep 17 00:00:00 2001 From: dimitr Date: Wed, 2 Feb 2011 08:15:27 +0000 Subject: [PATCH] Backported Adriano's correction. --- src/lock/lock.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lock/lock.cpp b/src/lock/lock.cpp index 080f772c90..68d01015a8 100644 --- a/src/lock/lock.cpp +++ b/src/lock/lock.cpp @@ -113,10 +113,10 @@ #define DEBUG_REMAP_INTERVAL 5000 static ULONG debug_remap_count = 0; #endif -#define CHECK(x) { if (!(x)) bug_assert ("consistency check", __LINE__); } +#define CHECK(x) do { if (!(x)) bug_assert ("consistency check", __LINE__); } while (false) #else // DEV_BUILD #define ASSERT_ACQUIRED -#define CHECK(x) +#define CHECK(x) do { } while (false) #endif // DEV_BUILD #ifdef DEBUG_LM @@ -1131,7 +1131,6 @@ void LockManager::acquire_shmem(SRQ_PTR owner_offset) } fb_assert(!m_sharedFileCreated); - ++m_header->lhb_acquires; if (prior_active > 0) { ++m_header->lhb_acquire_blocks; @@ -3522,7 +3521,7 @@ void LockManager::validate_lock(const SRQ_PTR lock_ptr, USHORT freed, const SRQ_ // The lbl_count's should never roll over to be negative for (ULONG i = 0; i < FB_NELEM(lock->lbl_counts); i++) - CHECK(!(lock->lbl_counts[i] & 0x8000)) + CHECK(!(lock->lbl_counts[i] & 0x8000)); // The count of pending locks should never roll over to be negative CHECK(!(lock->lbl_pending_lrq_count & 0x8000));