private void producer_FrameProduced(object sender, FrameProducedEventArgs e) { //------------------------- // Runs in producer thread. //------------------------- //heartbeat.Tick(); //if (benchmarkMode == BenchmarkMode.Heartbeat) //return; frequencyCounter.Tick(); // Claim the next slot in the ring buffer. Frame entry; bool claimed = true; /*if (benchmarkMode == BenchmarkMode.Bradycardia) * ringBuffer.Claim(out entry); * else*/ claimed = ringBuffer.TryClaim(out entry); if (!claimed) { // At least one consumer is still reading the slot we would like to write to. lock (lockerDrops) drops++; } else { WriteSlot(e.Buffer, e.PayloadLength, entry); } }