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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:154:   class conxion {    inherit Stdio.Buffer:i;    inherit Stdio.Buffer:o;       private Thread.Condition fillread;    private Thread.Mutex fillreadmux;    private Thread.Queue qportals;    final Stdio.File socket;    private object pgsqlsess;    private int towrite; +  private Thread.Mutex towritemux;       final function(:void) gottimeout;    final int timeout;    final Thread.Mutex nostash;    final Thread.MutexKey started;    final Thread.Mutex stashupdate;    final Thread.Queue stashqueue;    final Thread.Condition stashavail;    final Stdio.Buffer stash;    final int stashflushmode;
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:221:       private int read_cb(mixed id,mixed b) {    Thread.MutexKey lock=fillreadmux->lock();    if(fillread)    fillread.signal();    lock=0;    return 0;    }       private int write_cb() { +  Thread.MutexKey lock=towritemux->lock();    towrite-=output_to(socket,towrite); -  +  lock=0;    if(!fillread && !sizeof(this)) {    PD("%d>Close socket delayed\n",socket->query_fd());    socket->close();    }    return 0;    }       final inline int consume(int w) { return i::consume(w); }    final inline int unread(int w) { return i::unread(w); }    final inline string read(int w) { return i::read(w); }
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:282:   outer:    do {    switch(mode) {    default:    break outer;    case FLUSHSEND:    PD("Flush\n");    add(PGFLUSH);    case SENDOUT:;    } +  Thread.MutexKey lock=towritemux->lock();    if(towrite=sizeof(this)) {    PD("%d>Sendcmd %O\n",socket->query_fd(),((string)this)[..towrite-1]);    towrite-=output_to(socket,towrite);    } -  +  lock=0;    } while(0);    started=0;    return;    };    if(pgsqlsess)    pgsqlsess->_connectfail();    }       final void sendterminate() {    destruct(fillread); // Delayed close() after flushing the output buffer
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:374:    qportals->size(),sizeof(this),_size_object());    break;    }    return res;    }       protected void create(object _pgsqlsess,Thread.Queue _qportals,int nossl) {    i::create(); o::create();    qportals = _qportals;    synctransact = 1; +  towritemux=Thread.Mutex();    fillread=Thread.Condition();    fillreadmux=Thread.Mutex();    gottimeout=sendcmd; // Preset it with a NOP    timeout=128; // Just a reasonable amount    socket=Stdio.File();    nostash=Thread.Mutex();    stashupdate=Thread.Mutex();    stashqueue=Thread.Queue();    stashavail=Thread.Condition();    stash=Stdio.Buffer();