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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:182: Inside #if defined(PG_DEBUG)
   realbuffer->stashcount++;   #ifdef PG_DEBUG    if(waitforreal)    error("pgsql.bufcon not allowed here\n");   #endif    return this;    }       final void sendcmd(int mode,void|sql_result portal) {    Thread.MutexKey lock=realbuffer->shortmux->lock(); -  if(portal) { +  if (portal)    realbuffer->stashqueue->write(portal);    if (mode == SYNCSEND) {    add(PGSYNC);    realbuffer->stashqueue->write(1);    mode = SENDOUT; // Demote it to prevent an extra SYNC upon stashflush    } -  } +     realbuffer->stash->add(this); -  PD("%d>Got stash mode %d > %d\n", +  PD("%d>Stashed mode %d > %d\n",    realbuffer->socket->query_fd(), mode, realbuffer->stashflushmode);    if (mode > realbuffer->stashflushmode)    realbuffer->stashflushmode = mode;    if(!--realbuffer->stashcount)    realbuffer->stashavail.signal();    lock=0;    this->clear();    if(lock=realbuffer->nostash->trylock(1)) {   #ifdef PG_DEBUGRACE    conxsess sess = conxsess(realbuffer);
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:380:    lock = shortmux->lock();    mode = getstash(mode);    catch {   outer:    do {    switch(mode) {    default:    PD("%d>Skip flush %d Queue %O\n",    socket->query_fd(), mode, (string)this);    break outer; -  case FLUSHLOGSEND: +     case FLUSHSEND:    PD("Flush\n");    add(PGFLUSH);    case SENDOUT:;    }    if(towrite=sizeof(this)) {    PD("%d>Sendcmd %O\n",socket->query_fd(),((string)this)[..towrite-1]);    towrite-=output_to(socket,towrite);    }    } while(0);