title: Is there a generic "Object Pool" implementation for Delphi?
body: <p>I came across this while looking for a database connection pool implementation for Delphi.</p>
  
  <p>An object pool needs two methods:</p>
  
  <ul>
  <li><p>get - to acquire an object from the pool (this will create a new instance if the pool is empty or its size has not reached its maximum size), this methods must be thread safe so that one object can not be acquired by two threads at the same time. If all objects are iin use, the get method must block (maybe with an optional time out)</p></li>
  <li><p>put - to release (return) an object to the pool</p></li>
  </ul>
  
  <p>So a use case would look like</p>
  
  <pre><code>O := Pool.Get;
  try
    ... use O
  finally
    Pool.Put(O);
  end;
  </code></pre>
  
  <p>Update: added Delphi 2009 tag so Generics.Collections and TMonitor could be part of the implementation</p>