mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-03 09:39:40 +00:00
Use SQLITE_OPEN_NOMUTEX
This commit is contained in:
parent
a7e76c6f3d
commit
5913036638
1 changed files with 4 additions and 1 deletions
|
@ -16,7 +16,10 @@ namespace Sqlite3
|
|||
Db makeDb(std::string_view path, const char* schema)
|
||||
{
|
||||
sqlite3* handle = nullptr;
|
||||
const int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE;
|
||||
// All uses of NavMeshDb are protected by a mutex (navmeshtool) or serialized in a single thread (DbWorker)
|
||||
// so additional synchronization between threads is not required and SQLITE_OPEN_NOMUTEX can be used.
|
||||
// This is unsafe to use NavMeshDb without external synchronization because of internal state.
|
||||
const int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_NOMUTEX;
|
||||
if (const int ec = sqlite3_open_v2(std::string(path).c_str(), &handle, flags, nullptr); ec != SQLITE_OK)
|
||||
{
|
||||
const std::string message(sqlite3_errmsg(handle));
|
||||
|
|
Loading…
Reference in a new issue