Branch: Tag:

2018-05-11

2018-05-11 15:29:14 by Stephen R. van den Berg <srb@cuci.nl>

pgsql: Eliminate rare deadlock on heavy interleaved queries tuned.

862: Inside #if constant(__builtin.thread_id)
      /*semi*/private void _destruct() {    --parent->_count; +  MutexKey lock = parent->_mutex->lock();    parent->_cond->signal();    }   }
875: Inside #if constant(__builtin.thread_id)
  optional class ResourceCount {    /*semi*/final int _count;    /*semi*/final Condition _cond = Condition(); +  /*semi*/final Mutex _mutex = Mutex();       //! @param level    //! The maximum level that is considered drained.
887: Inside #if constant(__builtin.thread_id)
      //! Blocks until the resource-counter dips to max @ref{level@}.    //! -  //! @param lock -  //! A previously acquired @[MutexKey]. -  //! +     //! @param level    //! The maximum level that is considered drained. -  /*semi*/final void wait_till_drained(MutexKey lock, void|int level) { +  /*semi*/final void wait_till_drained(void|int level) {    while (_count > level) // Recheck before allowing further -  _cond->wait(lock); -  lock = 0; // Eliminate references +  _cond->wait(_mutex->lock());    }       //! Increments the resource-counter.