public PoolUtil() { unit = BaseDALPool.Instance().GetValidDal(); if (unit != null) { dalBase = unit.baseDal; } else { //这里应该要有忙碌的处理 } }
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); } }