public void Publish(long sequence)
        {
            SetAvailableBufferValue(CalculateIndex(sequence), CalculateAvailabilityFlag(sequence));

            if (_isBlockingWaitStrategy)
            {
                _waitStrategy.SignalAllWhenBlocking();
            }
        }
예제 #2
0
        public void Publish(long sequence)
        {
            SetAvailable(sequence);

            if (_isBlockingWaitStrategy)
            {
                _waitStrategy.SignalAllWhenBlocking();
            }
        }
예제 #3
0
        public void Publish(long sequence)
        {
            _cursor.SetValue(sequence);

            if (_isBlockingWaitStrategy)
            {
                _waitStrategy.SignalAllWhenBlocking();
            }
        }
 public void run()
 {
     try
     {
         barrier.SignalAndWait();
         if (0 != sleepTime)
         {
             Thread.Sleep(sleepTime);
         }
         sequence.IncrementAndGet();
         waitStrategy.SignalAllWhenBlocking();
     }
     catch (Exception e)
     {
         Console.WriteLine(e.ToString());
     }
 }
예제 #5
0
 public void Run()
 {
     try
     {
         _barrier.Signal();
         _barrier.Wait();
         if (0 != _sleepTime)
         {
             Thread.Sleep(_sleepTime);
         }
         Sequence.IncrementAndGet();
         _waitStrategy.SignalAllWhenBlocking();
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
예제 #6
0
 public void Alert()
 {
     _alerted = true;
     _waitStrategy.SignalAllWhenBlocking();
 }
 public void SignalAllWhenBlocking()
 {
     _fallbackStrategy.SignalAllWhenBlocking();
 }
예제 #8
0
 public void CancelProcessing()
 {
     _cancellationTokenSource.Cancel();
     _waitStrategy.SignalAllWhenBlocking();
 }
예제 #9
0
 /// <summary>
 /// Force the publication of a cursor sequence.
 ///
 /// Only use this method when forcing a sequence and you are sure only one publisher exists.
 /// This will cause the cursor to advance to this sequence.
 /// </summary>
 /// <param name="sequence">sequence which is to be forced for publication.</param>
 public void ForcePublish(long sequence)
 {
     _cursor.LazySet(sequence);
     _waitStrategy.SignalAllWhenBlocking();
 }