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 <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2020-05-04 18:25:51 +02:00
parent b80744903e
commit 2d0fab50c1

View File

@@ -108,7 +108,11 @@ public:
int totalChangesCount() { return m_databaseBackend.totalChangesCount(); }
void walCheckpointFull() override { m_databaseBackend.walCheckpointFull(); }
void walCheckpointFull() override
{
std::lock_guard<std::mutex> lock{m_databaseMutex};
m_databaseBackend.walCheckpointFull();
}
private:
void deferredBegin() override;