Exemplo n.º 1
0
            protected override void Producer()
            {
                Event asynchronousEvent = new TestStartedEvent(new TestSuite("Dummy"));

                this.q.Enqueue(asynchronousEvent);
                this.afterEnqueue = true;
                Thread.MemoryBarrier();
            }
Exemplo n.º 2
0
            private void Produce()
            {
                try
                {
                    Event    e     = new TestStartedEvent(new TestSuite("Dummy"));
                    DateTime start = DateTime.Now;
                    while (DateTime.Now - start <= TimeSpan.FromSeconds(3))
                    {
                        this.queue.Enqueue(e);
                        this.SentEventsCount++;
                        this.MaxQueueLength = Math.Max(this.queue.Count, this.MaxQueueLength);

                        // without Sleep or with just a Sleep(0), the EventPump thread does not keep up and the queue gets very long
                        if (this.delay)
                        {
                            Thread.Sleep(1);
                        }
                    }
                }
                catch (Exception ex)
                {
                    this.Exception = ex;
                }
            }
Exemplo n.º 3
0
            private void Produce()
            {
                try
                {
                    Event e = new TestStartedEvent(new TestSuite("Dummy"));
                    DateTime start = DateTime.Now;
                    while (DateTime.Now - start <= TimeSpan.FromSeconds(3))
                    {
                        this.queue.Enqueue(e);
                        this.SentEventsCount++;
                        this.MaxQueueLength = Math.Max(this.queue.Count, this.MaxQueueLength);

                        // without Sleep or with just a Sleep(0), the EventPump thread does not keep up and the queue gets very long
                        if (this.delay)
                            Thread.Sleep(1);
                    }
                }
                catch (Exception ex)
                {
                    this.Exception = ex;
                }
            }
Exemplo n.º 4
0
 protected override void Producer()
 {
     Event asynchronousEvent = new TestStartedEvent(new TestSuite("Dummy"));
     this.q.Enqueue(asynchronousEvent);
     this.afterEnqueue = true;
     Thread.MemoryBarrier();
 }