WaitIfStalled() public method

Blocks if documents writing is currently in a stalled state.
public WaitIfStalled ( ) : void
return void
Beispiel #1
0
            public override void Run()
            {
                try
                {
                    while (!stop)
                    {
                        ctrl.WaitIfStalled();
                        if (checkPoint)
                        {
#if FEATURE_THREAD_INTERRUPT
                            try
                            {
#endif
                            Assert.IsTrue(sync.await());
#if FEATURE_THREAD_INTERRUPT
                        }
                        catch (ThreadInterruptedException /*e*/)
                        {
                            Console.WriteLine("[Waiter] got interrupted - wait count: " + sync.waiter.CurrentCount);
                            //throw new ThreadInterruptedException("Thread Interrupted Exception", e);
                            throw;     // LUCENENET: CA2200: Rethrow to preserve stack details (https://docs.microsoft.com/en-us/visualstudio/code-quality/ca2200-rethrow-to-preserve-stack-details)
                        }
#endif
                        }
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.ToString());
                    Console.Write(e.StackTrace);
                    exceptions.Add(e);
                }
            }
 public override void Run()
 {
     try
     {
         while (!Stop.Get())
         {
             Ctrl.WaitIfStalled();
             if (CheckPoint.Get())
             {
                 try
                 {
                     Assert.IsTrue(Sync.@await());
                 }
                 catch (ThreadInterruptedException e)
                 {
                     Console.WriteLine("[Waiter] got interrupted - wait count: " + Sync.Waiter.Remaining);
                     throw new ThreadInterruptedException(e);
                 }
             }
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e.ToString());
         Console.Write(e.StackTrace);
         Exceptions.Add(e);
     }
 }
 public override void Run()
 {
     try
     {
         while (!stop)
         {
             ctrl.WaitIfStalled();
             if (checkPoint)
             {
                 try
                 {
                     Assert.IsTrue(sync.await());
                 }
                 catch (Exception e) when(e.IsInterruptedException())
                 {
                     Console.WriteLine("[Waiter] got interrupted - wait count: " + sync.waiter.CurrentCount);
                     throw; // LUCENENET: CA2200: Rethrow to preserve stack details (https://docs.microsoft.com/en-us/visualstudio/code-quality/ca2200-rethrow-to-preserve-stack-details)
                 }
             }
         }
     }
     catch (Exception e) when(e.IsThrowable())
     {
         Console.WriteLine(e.ToString());
         Console.Write(e.StackTrace);
         exceptions.Add(e);
     }
 }
            public override void Run()
            {
                try
                {
                    while (!Stop.Get())
                    {
                        Ctrl.WaitIfStalled();
                        if (CheckPoint.Get())
                        {
#if !NETSTANDARD
                            try
                            {
#endif
                            Assert.IsTrue(Sync.await());
#if !NETSTANDARD
                        }
                        catch (ThreadInterruptedException e)
                        {
                            Console.WriteLine("[Waiter] got interrupted - wait count: " + Sync.Waiter.CurrentCount);
                            throw new ThreadInterruptedException("Thread Interrupted Exception", e);
                        }
#endif
                        }
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.ToString());
                    Console.Write(e.StackTrace);
                    Exceptions.Add(e);
                }
            }
Beispiel #5
0
 public override void Run()
 {
     try
     {
         while (!stop)
         {
             ctrl.WaitIfStalled();
             if (checkPoint)
             {
                 try
                 {
                     Assert.IsTrue(sync.Await());
                 }
                 catch (Exception e) when(e.IsInterruptedException())
                 {
                     Console.WriteLine("[Waiter] got interrupted - wait count: " + sync.waiter.CurrentCount);
                     throw new Util.ThreadInterruptedException(e);
                 }
             }
         }
     }
     catch (Exception e) when(e.IsThrowable())
     {
         Console.WriteLine(e.ToString());
         Console.Write(e.StackTrace);
         exceptions.Add(e);
     }
 }
Beispiel #6
0
 /// <summary>
 /// This method will block if too many DWPT are currently flushing and no
 /// checked out DWPT are available
 /// </summary>
 internal void WaitIfStalled()
 {
     if (infoStream.IsEnabled("DWFC"))
     {
         infoStream.Message("DWFC", "waitIfStalled: numFlushesPending: " + flushQueue.Count + " netBytes: " + NetBytes + " flushBytes: " + FlushBytes + " fullFlush: " + fullFlush);
     }
     stallControl.WaitIfStalled();
 }
Beispiel #7
0
 /// <summary>
 /// this method will block if too many DWPT are currently flushing and no
 /// checked out DWPT are available
 /// </summary>
 internal void WaitIfStalled()
 {
     if (InfoStream_Renamed.IsEnabled("DWFC"))
     {
         InfoStream_Renamed.Message("DWFC", "waitIfStalled: numFlushesPending: " + FlushQueue.Count + " netBytes: " + NetBytes() + " flushBytes: " + FlushBytes() + " fullFlush: " + FullFlush_Renamed);
     }
     StallControl.WaitIfStalled();
 }
            public override void Run()
            {
                int iters = AtLeast(1000);

                for (int j = 0; j < iters; j++)
                {
                    Ctrl.UpdateStalled(Random().Next(StallProbability) == 0);
                    if (Random().Next(5) == 0) // thread 0 only updates
                    {
                        Ctrl.WaitIfStalled();
                    }
                }
            }
 public override void Run()
 {
     Ctrl.WaitIfStalled();
 }