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:
Gerhard Häring 2008-09-12 22:33:22 +00:00
parent 6e1afcf988
commit e6872eb417
3 changed files with 10 additions and 0 deletions

View file

@ -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;