コード例 #1
0
 public override IdRange NextIdBatch(int size)
 {
     lock (this)
     {
         IdRange range = IdQueue.nextIdBatch(size);
         if (range.TotalSize() == 0)
         {
             AskForNextRangeFromMaster();
             range = IdQueue.nextIdBatch(size);
         }
         return(range);
     }
 }
コード例 #2
0
 public override IdRange NextIdBatch(int size)
 {
     lock (this)
     {
         IdRange idBatch = GetReusableIdBatch(size);
         if (idBatch.TotalSize() > 0)
         {
             return(idBatch);
         }
         IdRange range = _idQueue.nextIdBatch(size);
         if (range.TotalSize() == 0)
         {
             AcquireNextIdBatch();
             range  = _idQueue.nextIdBatch(size);
             HighId = range.HighId;
         }
         return(range);
     }
 }