protected override void Producer() { Event asynchronousEvent = new TestStartedEvent(new TestSuite("Dummy")); this.q.Enqueue(asynchronousEvent); this.afterEnqueue = true; Thread.MemoryBarrier(); }
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; } }
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; } }
protected override void Producer() { Event asynchronousEvent = new TestStartedEvent(new TestSuite("Dummy")); this.q.Enqueue(asynchronousEvent); this.afterEnqueue = true; Thread.MemoryBarrier(); }