public void RemoveConnection(Driver driver)
{
lock ((inUsePool as ICollection).SyncRoot)
{
if (inUsePool.Contains(driver))
{
inUsePool.Remove(driver);
Interlocked.Increment(ref available);
autoEvent.Set();
}
}
// if we are being cleared and we are out of connections then have
// the manager destroy us.
if (beingCleared && NumConnections == 0)
MySqlPoolManager.RemoveClearedPool(this);
}