// A scheduler which always schedules into priority zero // always queue 0 protected override void SetUp() { Configuration conf = new Configuration(); conf.SetInt("ns." + FairCallQueue.IpcCallqueuePriorityLevelsKey, 2); fcq = new FairCallQueue <Schedulable>(5, "ns", conf); }
public long[] GetOverflowedCalls() { FairCallQueue obj = this.delegate_.Get(); if (obj == null) { return(new long[] { }); } return(obj.GetOverflowedCalls()); }
public int[] GetQueueSizes() { FairCallQueue obj = this.delegate_.Get(); if (obj == null) { return(new int[] { }); } return(obj.GetQueueSizes()); }
public virtual void TestDrainToWithLimit() { Configuration conf = new Configuration(); conf.SetInt("ns." + FairCallQueue.IpcCallqueuePriorityLevelsKey, 2); FairCallQueue <Schedulable> fcq2 = new FairCallQueue <Schedulable>(10, "ns", conf); fcq.SetScheduler(alwaysZeroScheduler); fcq2.SetScheduler(alwaysZeroScheduler); // Start with 3 in fcq, to be drained for (int i = 0; i < 3; i++) { fcq.Offer(MockCall("c")); } fcq.DrainTo(fcq2, 2); Assert.Equal(1, fcq.Count); Assert.Equal(2, fcq2.Count); }
public void SetDelegate(FairCallQueue obj) { this.delegate_ = new WeakReference <FairCallQueue>(obj); this.revisionNumber++; }