Sets the default thread mode. SQLite supports three thread modes.
Value | Mode | Meaning |
---|---|---|
0 | Single thread | Disables thread support |
1 | Fully serialized | Full thread support |
2 | Multithread | Basic thread support |
Single thread mode disables all mutexes and thread support. In this mode, the locking code is completely removed from the build and the mode cannot be changed. All interaction with the SQLite library must be done from a single thread.
Serialized allows a database connection to be used across multiple threads. Multithread allows the SQLite library to be used by multiple threads, but a database connection can only be used by one thread at a time.
If an application is built with thread support, it can switch
between thread-safe modes (1
or 2
) at application
startup.