Clear() private method

Clears this pool of all idle connections and marks this pool and being cleared so all other connections are closed when they are returned.
private Clear ( ) : void
return void
Exemplo n.º 1
0
 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);
				}
			}
		}
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
        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);
            }
        }