Changeset 327


Ignore:
Timestamp:
Sep 16, 2008, 11:15:20 AM (11 years ago)
Author:
cito
Message:

Release the GIL while making a connection, as suggested by Peter Schuller.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/module/pgmodule.c

    r323 r327  
    11/*
    2  * $Id: pgmodule.c,v 1.76 2007-10-12 12:20:00 darcy Exp $
     2 * $Id: pgmodule.c,v 1.77 2008-09-16 15:15:20 cito Exp $
    33 * PyGres, version 2.2 A Python interface for PostgreSQL database. Written by
    44 * D'Arcy J.M. Cain, (darcy@druid.net).  Based heavily on code written by
     
    16121612                memset(port_buffer, 0, sizeof(port_buffer));
    16131613                sprintf(port_buffer, "%d", pgport);
    1614                 npgobj->cnx = PQsetdbLogin(pghost, port_buffer,
    1615                         pgopt, pgtty, pgdbname, pguser, pgpasswd);
    1616         }
    1617         else
    1618                 npgobj->cnx = PQsetdbLogin(pghost, NULL,
    1619                         pgopt, pgtty, pgdbname, pguser, pgpasswd);
     1614        }
     1615
     1616        Py_BEGIN_ALLOW_THREADS
     1617        npgobj->cnx = PQsetdbLogin(pghost, pgport == -1 ? NULL : port_buffer,
     1618                pgopt, pgtty, pgdbname, pguser, pgpasswd);
     1619        Py_END_ALLOW_THREADS
    16201620
    16211621        if (PQstatus(npgobj->cnx) == CONNECTION_BAD)
Note: See TracChangeset for help on using the changeset viewer.