summaryrefslogtreecommitdiff
path: root/psycopg/connection_int.c
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-06-05 16:22:54 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-06-05 16:22:54 +0100
commit8f876d4b5d26a4e618d0cdcb2189b5ee3abf97c6 (patch)
treeef5ff2250178d2f0a937f103174ea3ae22fd2796 /psycopg/connection_int.c
parentdcc9e84a68a0aa446b924c308a81605d57965859 (diff)
downloadpsycopg2-8f876d4b5d26a4e618d0cdcb2189b5ee3abf97c6.tar.gz
Avoid a deadlock using concurrent green threads on the same connection
Use the async_cursor property to store an indication that something is running (even if it is not necessarily a cursor running the query).
Diffstat (limited to 'psycopg/connection_int.c')
-rw-r--r--psycopg/connection_int.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/psycopg/connection_int.c b/psycopg/connection_int.c
index 24d424d..6a1d9c5 100644
--- a/psycopg/connection_int.c
+++ b/psycopg/connection_int.c
@@ -881,7 +881,7 @@ conn_poll(connectionObject *self)
case CONN_STATUS_PREPARED:
res = _conn_poll_query(self);
- if (res == PSYCO_POLL_OK && self->async_cursor) {
+ if (res == PSYCO_POLL_OK && self->async && self->async_cursor) {
/* An async query has just finished: parse the tuple in the
* target cursor. */
cursorObject *curs;