Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/offline/SQLiteWrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,9 @@ namespace MAT_NS_BEGIN {
}

bool lock() {
#ifndef NDEBUG
unsigned count = 0;
#endif
unsigned waitTime = 0;
while (!trylock()) {
if (waitTime >= MAX_DB_LOCKWAIT_DELAY) {
Expand All @@ -452,8 +454,10 @@ namespace MAT_NS_BEGIN {
return false;
}
waitTime += MAX_DB_LOCKWAIT_DELAY; // 500ms, 1000ms
#ifndef NDEBUG
count++;
LOG_DEBUG("Lock: waiting to acquire the lock: count=%u, waitTime=%u", count, waitTime);
#endif
PAL::sleep(MAX_DB_LOCKWAIT_DELAY);
}
LOG_DEBUG("Lock: acquired [time=%u]", waitTime);
Expand Down