pike.git/
lib/
modules/
Sql.pmod/
pgsql.pike
Branch:
Tag:
Non-build tags
All tags
No tags
2016-10-18
2016-10-18 22:38:33 by Stephen R. van den Berg <srb@cuci.nl>
4af062b317931f26d52c75fe3ad405d1c95aad9a (
15
lines) (+
10
/-
5
)
[
Show
|
Annotate
]
Branch:
8.0
pgsql: Fix race when connections are closing and receive new commands.
1207:
//! 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() {
1270:
#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");