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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:1499:    PD("Commit waiting for statements to finish\n");    catch(PT(pgsqlsess->statementsinflight->wait_till_drained()));    }    stmtifkey = pgsqlsess->statementsinflight->acquire();    }    statuscmdcomplete = 0;    pgsqlsess->wasparallelisable = paralleliseprefix->match(_query);    }       final void _releasestatement() { -  Thread.MutexKey lock = closemux->lock(2); +  Thread.MutexKey lock = closemux->lock();    if (_state <= BOUND) {    _state = COMMITTED;    stmtifkey = 0;    }    }       final void _bindportal() {    Thread.MutexKey lock = closemux->lock();    _state = BOUND;    portalsifkey = pgsqlsess->portalsinflight->acquire();
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:1542:    }       final int _closeportal(conxsess cs, array(Thread.MutexKey) reflock) {    void|bufcon|conxsess plugbuffer = CHAIN(cs);    int retval = KEEP;    PD("%O Try Closeportal %d\n", _portalname, _state);    _fetchlimit = 0; // disables further Executes    switch (_state) {    case PARSING:    case BOUND: -  _releasestatement(); +  _state = COMMITTED; // Avoid _releasestatement() to prevent +  stmtifkey = 0; // lock recursion and lock inversion deadlock    }    switch (_state) {    case PORTALINIT:    case PARSING:    _unnamedstatementkey = 0;    _state = CLOSING;    break;    case COPYINPROGRESS:    PD("CopyDone\n");    plugbuffer->add("c\0\0\0\4");