Пример #1
0
 public static ConnectionPools getInstance()
 {
     lock (_instantiationLocker)
     {
         if (_thePool == null)
         {
             _thePool = new ConnectionPools();
         }
     }
     return(_thePool);
 }
Пример #2
0
 public static ConnectionPools getInstance()
 {
     lock (_instantiationLocker)
     {
         if (_thePool == null)
         {
             _thePool = new ConnectionPools();
         }
     }
     return _thePool;
 }
Пример #3
0
        public ConnectionPools getPools(AbstractPoolSource source)
        {
            if (source == null)
            {
                throw new ArgumentException("Need to supply pool source before connection pool can be built");
            }
            ConnectionPools pool = ConnectionPools.getInstance();

            pool.PoolSource = (ConnectionPoolsSource)source;
            Thread poolThread = new Thread(new ThreadStart(pool.run));

            poolThread.Name         = "PoolOfPools";
            poolThread.IsBackground = true; // this allows the main process to terminate without the connection pool being forced to clean up - ok?
            poolThread.Start();
            return(pool);
        }