Name
sqlite3_db_mutex() — Extract a database connection mutex lock
Definition
sqlite3_mutex* sqlite3_db_mutex( sqlite3* db );
-
db A database connection.
- Returns
The database connection mutex lock. If the library is not in the “serialized” threading mode, a NULL pointer will be returned.
Description
This function extracts and returns a reference to the mutual exclusion lock associated with the given database connection. The SQLite library must be in the “serialized” threading mode. If it is in any other mode, this function will return NULL.
The mutex object can be used to lock the database connection for the purpose of avoiding race conditions, especially when accessing error messages or row counts that are stored as part of the database connection.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access