From 2d0fab50c1a53d603d61ae6c4a56b73c1ffba77a Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 4 May 2020 18:25:51 +0200 Subject: [PATCH] Sqlite: Locking the walCheckpointFull() To call this function from a thread we have to lock it. There is no test because there is no reasonable way to doing it. Anyway, this code is very simple, so there no reason to see that there is an error in it. Change-Id: Ibe57ddf421bc60929993afedecbde8c8486eb4db Reviewed-by: Tim Jenssen --- src/libs/sqlite/sqlitedatabase.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libs/sqlite/sqlitedatabase.h b/src/libs/sqlite/sqlitedatabase.h index 2c35a293c23..323ac803259 100644 --- a/src/libs/sqlite/sqlitedatabase.h +++ b/src/libs/sqlite/sqlitedatabase.h @@ -108,7 +108,11 @@ public: int totalChangesCount() { return m_databaseBackend.totalChangesCount(); } - void walCheckpointFull() override { m_databaseBackend.walCheckpointFull(); } + void walCheckpointFull() override + { + std::lock_guard lock{m_databaseMutex}; + m_databaseBackend.walCheckpointFull(); + } private: void deferredBegin() override;