public void ReleaseConnection(Driver driver) { lock (((ICollection)this.inUsePool).SyncRoot) { if (this.inUsePool.Contains(driver)) { this.inUsePool.Remove(driver); } } if (driver.IsTooOld() || this.beingCleared) { driver.Close(); } else { lock (((ICollection)this.idlePool).SyncRoot) { this.idlePool.Enqueue(driver); } } Interlocked.Increment(ref this.available); this.autoEvent.Set(); }
public static void SetDriverInTransaction(Driver driver) { lock (driversInUse.SyncRoot) { driversInUse[driver.CurrentTransaction.BaseTransaction.GetHashCode()] = driver; } }
public void RemoveConnection(Driver driver) { lock (((ICollection)this.inUsePool).SyncRoot) { if (this.inUsePool.Contains(driver)) { this.inUsePool.Remove(driver); Interlocked.Increment(ref this.available); this.autoEvent.Set(); } } if (this.beingCleared && (this.NumConnections == 0)) { MySqlPoolManager.RemoveClearedPool(this); } }
public static void RemoveConnection(Driver driver) { MySqlPool pool = driver.Pool; if (pool != null) { pool.RemoveConnection(driver); } }