diff options
| author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2011-06-05 16:22:54 +0100 |
|---|---|---|
| committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2011-06-05 16:22:54 +0100 |
| commit | 8f876d4b5d26a4e618d0cdcb2189b5ee3abf97c6 (patch) | |
| tree | ef5ff2250178d2f0a937f103174ea3ae22fd2796 /psycopg/connection.h | |
| parent | dcc9e84a68a0aa446b924c308a81605d57965859 (diff) | |
| download | psycopg2-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.h')
| -rw-r--r-- | psycopg/connection.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/psycopg/connection.h b/psycopg/connection.h index d79392b..24b3be3 100644 --- a/psycopg/connection.h +++ b/psycopg/connection.h @@ -91,7 +91,10 @@ typedef struct { PGconn *pgconn; /* the postgresql connection */ PGcancel *cancel; /* the cancellation structure */ - PyObject *async_cursor; /* weakref to a cursor executing an asynchronous query */ + /* Weakref to the object executing an asynchronous query. The object + * is a cursor for async connections, but it may be something else + * for a green connection. If NULL, the connection is idle. */ + PyObject *async_cursor; int async_status; /* asynchronous execution status */ /* notice processing */ |
