mirror of
https://github.com/python/cpython.git
synced 2025-09-18 06:30:38 +00:00
Issue #3846: Release GIL during calls to sqlite3_prepare. This improves concurrent access to the same database file from multiple threads/processes.
This commit is contained in:
parent
6e1afcf988
commit
e6872eb417
3 changed files with 10 additions and 0 deletions
|
@ -790,11 +790,13 @@ PyObject* pysqlite_cursor_executescript(pysqlite_Cursor* self, PyObject* args)
|
|||
}
|
||||
statement_completed = 1;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
rc = sqlite3_prepare(self->connection->db,
|
||||
script_cstr,
|
||||
-1,
|
||||
&statement,
|
||||
&script_cstr);
|
||||
Py_END_ALLOW_THREADS
|
||||
if (rc != SQLITE_OK) {
|
||||
_pysqlite_seterror(self->connection->db, NULL);
|
||||
goto error;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue