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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:643:    datarowdesc=drowdesc;    _ddescribe->broadcast();    lock=0;    }       final void _preparebind(array dtoid) {    array(string|int) paramValues=_params?_params[2]:({});    if(sizeof(dtoid)!=sizeof(paramValues))    SUSERERROR("Invalid number of bindings, expected %d, got %d\n",    sizeof(dtoid),sizeof(paramValues)); +  Thread.MutexKey lock=prepbuffermux->lock(); +  if(!_portalname) { +  _portalname=(_unnamedportalkey=pgsqlsess._unnamedportalmux->trylock(1)) +  ? "" : PORTALPREFIX + #ifdef PG_DEBUG +  +(string)(c->socket->query_fd())+"_" + #endif +  +int2hex(pgsqlsess._pportalcount++); +  lock=0;   #ifdef PG_DEBUGMORE    PD("ParamValues to bind: %O\n",paramValues);   #endif    Stdio.Buffer plugbuffer=Stdio.Buffer();    plugbuffer->add(_portalname=    (_unnamedportalkey=pgsqlsess._unnamedportalmux->trylock(1))    ? "" : PORTALPREFIX   #ifdef PG_DEBUG    +(string)(c->socket->query_fd())+"_"   #endif
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:777:    plugbuffer->add_int32(2)->add_int16((int)value);    break;    }    }    if(_tprepared)    if(_tprepared.datarowdesc)    gotdatarowdesc(plugbuffer);    else if(dontcacheprefix->match(_query)) // Don't cache FETCH/COPY    m_delete(pgsqlsess->_prepareds,_query),_tprepared=0;    if(prepbufferready) { -  Thread.MutexKey lock=prepbuffermux->lock(); +  lock=prepbuffermux->lock();    prepbuffer=plugbuffer;    catch(prepbufferready->signal()); -  lock=0; +     }    } -  +  lock=0; +  }       final void _processrowdesc(array(mapping(string:mixed)) datarowdesc) {    _setrowdesc(datarowdesc);    if(_tprepared)    _tprepared.datarowdesc=datarowdesc;    if(prepbufferready)    Thread.Thread(gotdatarowdesc); // Do not use callout, it deadlocks    }       private void gotdatarowdesc(void|Stdio.Buffer plugbuffer) {