Branch: Tag:

2016-02-17

2016-02-17 18:57:17 by Stephen R. van den Berg <srb@cuci.nl>

pgsql: Terminate threads when connections are idle.

208:    PD("Read callback %O\n",(string)b);    Thread.MutexKey lock=fillreadmux->lock();    if(procmsg) -  procmsg=0,lock=0,Thread.Thread(id); +  procmsg=0,lock=0,Thread.Thread(id());    else if(fillread)    didreadcb=1, fillread.signal();    lock=0;
355:    }       protected void destroy() { -  catch { // Exceptions don't work inside destructors -  close(); -  socket->set_callbacks(); // Clear all callbacks -  }; +  catch(close()); // Exceptions don't work inside destructors    connectfail=0;    }   
403:    socket->set_backend(local_backend);    socket->set_buffer_mode(i,0);    socket->set_nonblocking(i->read_cb,write_cb,close); +  connectfail=pgsqlsess->_connectfail;    Thread.Thread(pgsqlsess->_processloop,this);    return;    };