Skip to content

Commit 6991de6

Browse files
authored
adding conditional compliation for the code which is supposed to run only for debug mode builds, to fix release unused variable as error (#1240)
1 parent e8dd205 commit 6991de6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/offline/SQLiteWrapper.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,9 @@ namespace MAT_NS_BEGIN {
440440
}
441441

442442
bool lock() {
443+
#ifndef NDEBUG
443444
unsigned count = 0;
445+
#endif
444446
unsigned waitTime = 0;
445447
while (!trylock()) {
446448
if (waitTime >= MAX_DB_LOCKWAIT_DELAY) {
@@ -452,8 +454,10 @@ namespace MAT_NS_BEGIN {
452454
return false;
453455
}
454456
waitTime += MAX_DB_LOCKWAIT_DELAY; // 500ms, 1000ms
457+
#ifndef NDEBUG
455458
count++;
456459
LOG_DEBUG("Lock: waiting to acquire the lock: count=%u, waitTime=%u", count, waitTime);
460+
#endif
457461
PAL::sleep(MAX_DB_LOCKWAIT_DELAY);
458462
}
459463
LOG_DEBUG("Lock: acquired [time=%u]", waitTime);

0 commit comments

Comments
 (0)