示例#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);
     }
 }