summaryrefslogtreecommitdiff
path: root/psycopg/pqpath.h
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-04-05 01:42:30 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-04-21 15:21:33 +0100
commit0ec73a18b47040b8fef41a8e546057b767b26e26 (patch)
treec8584a14a03e6f8dc4f10a25227e0ed4f88f9af0 /psycopg/pqpath.h
parent7a06c0455b914ba3fc4a8a819aba2e95d78bda74 (diff)
downloadpsycopg2-0ec73a18b47040b8fef41a8e546057b767b26e26.tar.gz
'pq_execute_command_locked()' calls the wait callback if set.
The function is called without holding the GIL. Because it is necessary to execute the Python callback if set, we need to re-acquire the GIL and tnen release it again. In order to correctly bookkeep the thread state, the pointer of the _save variable is passed to the function.
Diffstat (limited to 'psycopg/pqpath.h')
-rw-r--r--psycopg/pqpath.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/psycopg/pqpath.h b/psycopg/pqpath.h
index 7ae38dd..e7e957e 100644
--- a/psycopg/pqpath.h
+++ b/psycopg/pqpath.h
@@ -38,10 +38,10 @@
HIDDEN int pq_fetch(cursorObject *curs);
HIDDEN int pq_execute(cursorObject *curs, const char *query, int async);
HIDDEN int pq_begin_locked(connectionObject *conn, PGresult **pgres,
- char **error);
+ char **error, PyThreadState **tstate);
HIDDEN int pq_commit(connectionObject *conn);
HIDDEN int pq_abort_locked(connectionObject *conn, PGresult **pgres,
- char **error);
+ char **error, PyThreadState **tstate);
HIDDEN int pq_abort(connectionObject *conn);
HIDDEN int pq_reset(connectionObject *conn);
HIDDEN int pq_is_busy(connectionObject *conn);
@@ -53,7 +53,8 @@ HIDDEN void pq_set_critical(connectionObject *conn, const char *msg);
HIDDEN int pq_execute_command_locked(connectionObject *conn,
const char *query,
- PGresult **pgres, char **error);
+ PGresult **pgres, char **error,
+ PyThreadState **tstate);
HIDDEN void pq_complete_error(connectionObject *conn, PGresult **pgres,
char **error);