Ejemplo n.º 1
0
		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();
		}
Ejemplo n.º 2
0
		public static void SetDriverInTransaction(Driver driver) {
			lock (driversInUse.SyncRoot) {
				driversInUse[driver.CurrentTransaction.BaseTransaction.GetHashCode()] = driver;
			}
		}
Ejemplo n.º 3
0
		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);
			}
		}
Ejemplo n.º 4
0
		public static void RemoveConnection(Driver driver) {
			MySqlPool pool = driver.Pool;
			if (pool != null) {
				pool.RemoveConnection(driver);
			}
		}