private static void ClearPoolByText(string key) { lock (MySqlPoolManager.pools) { if (MySqlPoolManager.pools.ContainsKey(key)) { MySqlPool mySqlPool = MySqlPoolManager.pools[key]; MySqlPoolManager.clearingPools.Add(mySqlPool); mySqlPool.Clear(); MySqlPoolManager.pools.Remove(key); } } }
private static void ClearPoolByText(string key) { Dictionary<string, MySqlPool> obj = MySqlPoolManager.pools; lock (obj) { if (MySqlPoolManager.pools.ContainsKey(key)) { MySqlPool mySqlPool = MySqlPoolManager.pools[key]; MySqlPoolManager.clearingPools.Add(mySqlPool); mySqlPool.Clear(); MySqlPoolManager.pools.Remove(key); } } }
private static void ClearPoolByText(string key) { lock (pools.SyncRoot) { // add the pool to our list of pools being cleared MySqlPool pool = (pools[key] as MySqlPool); clearingPools.Add(pool); // now tell the pool to clear itself pool.Clear(); // and then remove the pool from the active pools list pools.Remove(key); } }
private static void ClearPoolByText(string key) { lock (pools.SyncRoot) { // if pools doesn't have it, then this pool must already have been cleared if (!pools.ContainsKey(key)) { return; } // add the pool to our list of pools being cleared MySqlPool pool = (pools[key] as MySqlPool); clearingPools.Add(pool); // now tell the pool to clear itself pool.Clear(); // and then remove the pool from the active pools list pools.Remove(key); } }