예제 #1
0
 public PoolUtil()
 {
     unit = BaseDALPool.Instance().GetValidDal();
     if (unit != null)
     {
         dalBase = unit.baseDal;
     }
     else
     {
         //这里应该要有忙碌的处理
     }
 }
예제 #2
0
 public PoolUtil()
 {
     unit = BaseDALPool.Instance().GetValidDal();
     if (unit != null)
     {
         dalBase = unit.baseDal;
     }
     else
     {
         //这里应该要有忙碌的处理
     }
 }
예제 #3
0
 public PoolUnit GetValidDal()
 {
     lock (threadLock)
     {
         PoolUnit unit = null;
         for (int i = 0; i < GLB.attemptTime; ++i)
         {
             unit = poolUnits.Find((u) => u.IsUse == false);
             if (unit != null)
             {
                 break;
             }
             Thread.Sleep(100);
         }
         return(unit);
     }
 }