Branch: Tag:

2016-02-24

2016-02-24 12:45:30 by Stephen R. van den Berg <srb@cuci.nl>

pgsql: Sync destruction of objects with natural thread termination.

228:       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;
355:    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) {
435:    i=conxiin();    shortmux=Thread.Mutex();    nostash=Thread.Mutex(); +  termthread=Thread.Mutex();    stashavail=Thread.Condition();    stashqueue=Thread.Queue();    stash=Stdio.Buffer();