pike.git / lib / modules / Sql.pmod / pgsql.pike

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql.pike:56:      #pike __REAL_VERSION__   #require constant(Thread.Thread)      #include "pgsql.h"      #define ERROR(X ...) predef::error(X)      final int _fetchlimit=FETCHLIMIT;   final Thread.Mutex _unnamedportalmux; - private Thread.Mutex unnamedstatement,termthread; + private Thread.Mutex unnamedstatement;   private Thread.MutexKey termlock;   final int _portalsinflight;      private .pgsql_util.conxion c;   private string cancelsecret;   private int backendpid, backendstatus;   final mapping(string:mixed) _options;   private array(string) lastmessage=({});   private int clearmessage;   private mapping(string:array(mixed)) notifylist=([]);
pike.git/lib/modules/Sql.pmod/pgsql.pike:1194:      //! Closes the connection to the database, any running queries are   //! terminated instantly.   //!   //! @note   //! This function is PostgreSQL-specific, and thus it is not available   //! through the generic SQL-interface.   /*semi*/final void close() {    if(qportals && qportals->size())    catch(cancelquery()); -  termlock=(termthread=Thread.Mutex())->lock(); +  termlock=unnamedstatement->lock(1);    c->close(); -  termthread->lock(1); +  unnamedstatement->lock(1);    destruct(c);destruct(waitforauthready);   }      protected void destroy() {    catch(close());    .pgsql_util.unregister_backend();   }      final void _connectfail(void|mixed err) {    PD("Connect failed %O reconnectdelay %d\n",err,reconnectdelay);
pike.git/lib/modules/Sql.pmod/pgsql.pike:1251:    }    waitforauthready=Thread.Condition();    lock=0;    }    if(c) {    PD("Close old connection\n");    reconnected++;recon=1;   #ifdef PG_STATS    prepstmtused=0;   #endif -  termlock=(termthread=Thread.Mutex())->lock(); +  termlock=unnamedstatement->lock(1);    c->close(); -  termthread->lock(1); +  unnamedstatement->lock(1);    destruct(c);    PD("Flushing old cache\n");    foreach(_prepareds;;mapping tp)    m_delete(tp,"preparedname");    if(!_options.reconnect)    ERROR("Lost connection to database %s:%d\n",_host,_port);    }    PD("Actually start to connect\n");    qportals=Thread.Queue();    _readyforcommit=Thread.Condition();