pike.git
/
lib
/
modules
/
Sql.pmod
/
pgsql_util.pmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:461:
portal._portalname, ++queueoutidx, synctransact, sizeof(this)); } final bufcon|conxsess start(void|int waitforreal) { Thread.MutexKey lock; #ifdef PG_DEBUGRACE if (nostash->current_locking_thread()) PD("Nostash locked by %s\n", describe_backtrace(nostash->current_locking_thread()->backtrace())); #endif
-
if
(lock = (waitforreal ? nostash->lock : nostash->trylock)(1)) {
+
while
(lock = (waitforreal ? nostash->lock : nostash->trylock)(1)) {
+
int mode;
+
if (sizeof(stash) && (mode = getstash(KEEP)) > KEEP)
+
sendcmd(mode); // Force out stash to the server
+
if (!stashcount->drained()) {
+
lock = 0; // Unlock while we wait
stashcount->wait_till_drained();
-
+
continue; // Try again
+
}
#ifdef PG_DEBUGRACE conxsess sess = conxsess(this); #endif
-
int mode;
-
if (sizeof(stash) && (mode = getstash(KEEP)) > KEEP)
-
sendcmd(mode); // Force out stash to the server
+
started = lock; // sendcmd() clears started, so delay assignment #ifdef PG_DEBUGRACE return sess; #else return this; #endif } return bufcon(this)->start(); }