pike.git
/
lib
/
modules
/
Sql.pmod
/
pgsql.pike
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Sql.pmod/pgsql.pike:1200:
} } //! 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())
+
Thread.MutexKey lock;
+
if
(qportals && qportals->size())
catch(cancelquery()); if (unnamedstatement)
-
termlock=unnamedstatement->lock(1);
+
termlock
=
unnamedstatement->lock(1);
c->close(); if (unnamedstatement)
-
unnamedstatement->lock(1);
-
destruct(c);destruct(waitforauthready);
+
lock =
unnamedstatement->lock(1);
+
destruct(c);
+
lock = 0;
+
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); destruct(waitforauthready);
pike.git/lib/modules/Sql.pmod/pgsql.pike:1263:
lock=0; } if(c) { PD("Close old connection\n"); reconnected++;recon=1; #ifdef PG_STATS prepstmtused=0; #endif termlock=unnamedstatement->lock(1); c->close();
-
unnamedstatement->lock(1);
+
Thread.MutexKey lock =
unnamedstatement->lock(1);
destruct(c);
-
+
lock = 0;
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(); _readyforquerycount=1;