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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:221:    fillread=Thread.Condition();    }   };      class conxion {    inherit Stdio.Buffer:o;    final conxiin i;       private Thread.Queue qportals;    final Thread.Mutex shortmux; +  private Thread.Mutex termthread; +  private Thread.MutexKey termlock; +     final Stdio.File socket;    private function(void|mixed:void) connectfail;    private int towrite;    final multiset(function(void|mixed:void)) closecallbacks=(<>);       final Thread.Mutex nostash;    final Thread.MutexKey started;    final Thread.Queue stashqueue;    final Thread.Condition stashavail;    final Stdio.Buffer stash;
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:348:    return ret;    }    lock=0;    }    destruct(nostash);    PD("%d>Close socket\n",socket->query_fd());    ret=socket->close();    foreach(closecallbacks;function(void|mixed:void) closecb;)    closecb();    closecallbacks=(<>); +  termlock=0;    return ret;    }       protected void destroy() { -  +  termlock=termthread->lock();    catch(close()); // Exceptions don't work inside destructors    connectfail=0; -  +  termthread->lock(1);    }       final void connectloop(object pgsqlsess, int nossl) {    mixed err=catch {    for(;;clear()) {    socket->connect(pgsqlsess._host,pgsqlsess._port);   #if constant(SSL.File)    if(!nossl && !pgsqlsess->nossl    && (pgsqlsess._options.use_ssl || pgsqlsess._options.force_ssl)) {    PD("SSLRequest\n");
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:428:    }       protected void create(object pgsqlsess,Thread.Queue _qportals,int nossl) {    o::create();    qportals = _qportals;    synctransact = 1;    socket=Stdio.File();    i=conxiin();    shortmux=Thread.Mutex();    nostash=Thread.Mutex(); +  termthread=Thread.Mutex();    stashavail=Thread.Condition();    stashqueue=Thread.Queue();    stash=Stdio.Buffer();    Thread.Thread(connectloop,pgsqlsess,nossl);    }   };      //! The result object returned by @[Sql.pgsql()->big_query()], except for   //! the noted differences it behaves the same as @[Sql.sql_result].   //!