Пример #1
0
 public WriteManager(FlushableOutgoingEntryReceiver foer, NTThreadManager nttm, AbstractNetworkTableEntryStore antes, long l)
 {
   base.\u002Ector();
   WriteManager writeManager = this;
   this.SLEEP_TIME = 100;
   this.queueSize = 500;
   this.transactionsLock = (object) new Object();
   this.receiver = foer;
   this.threadManager = nttm;
   this.entryStore = antes;
   this.incomingAssignmentQueue = new HalfQueue(500);
   Thread.MemoryBarrier();
   this.incomingUpdateQueue = new HalfQueue(500);
   Thread.MemoryBarrier();
   this.outgoingAssignmentQueue = new HalfQueue(500);
   Thread.MemoryBarrier();
   this.outgoingUpdateQueue = new HalfQueue(500);
   Thread.MemoryBarrier();
   this.keepAliveDelay = l;
 }
Пример #2
0
 public virtual void run()
 {
   object obj;
   Monitor.Enter(obj = this.transactionsLock);
   // ISSUE: fault handler
   try
   {
     HalfQueue halfQueue1 = this.incomingAssignmentQueue;
     this.incomingAssignmentQueue = this.outgoingAssignmentQueue;
     this.outgoingAssignmentQueue = halfQueue1;
     Thread.MemoryBarrier();
     HalfQueue halfQueue2 = this.incomingUpdateQueue;
     this.incomingUpdateQueue = this.outgoingUpdateQueue;
     this.outgoingUpdateQueue = halfQueue2;
     Thread.MemoryBarrier();
     Monitor.Exit(obj);
   }
   __fault
   {
     Monitor.Exit(obj);
   }
   int num1 = 0;
   int num2 = this.outgoingAssignmentQueue.size();
   object[] objArray1 = this.outgoingAssignmentQueue.__\u003C\u003Earray;
   for (int index = 0; index < num2; ++index)
   {
     NetworkTableEntry nte = (NetworkTableEntry) objArray1[index];
     AbstractNetworkTableEntryStore networkTableEntryStore;
     Monitor.Enter((object) (networkTableEntryStore = this.entryStore));
     // ISSUE: fault handler
     try
     {
       nte.makeClean();
       Monitor.Exit((object) networkTableEntryStore);
     }
     __fault
     {
       Monitor.Exit((object) networkTableEntryStore);
     }
     num1 = 1;
     this.receiver.offerOutgoingAssignment(nte);
   }
   this.outgoingAssignmentQueue.clear();
   int num3 = this.outgoingUpdateQueue.size();
   object[] objArray2 = this.outgoingUpdateQueue.__\u003C\u003Earray;
   for (int index = 0; index < num3; ++index)
   {
     NetworkTableEntry nte = (NetworkTableEntry) objArray2[index];
     lock (this.entryStore)
       nte.makeClean();
     num1 = 1;
     this.receiver.offerOutgoingUpdate(nte);
   }
   this.outgoingUpdateQueue.clear();
   if (num1 != 0)
   {
     this.receiver.flush();
     this.lastWrite = System.currentTimeMillis();
   }
   else if (System.currentTimeMillis() - this.lastWrite > this.keepAliveDelay)
     this.receiver.ensureAlive();
   Thread.sleep(100L);
 }