MCPcopy Create free account
hub / github.com/chronoxor/CppBenchmark / RunProducer

Method RunProducer

examples/spsc.cpp:135–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 }
134
135 void RunProducer(CppBenchmark::ContextPC& context) override
136 {
137 if (_count >= items_to_produce)
138 {
139 _queue->enqueue(0);
140 context.StopProduce();
141 return;
142 }
143
144 _queue->enqueue(_count++);
145 }
146
147 void RunConsumer(CppBenchmark::ContextPC& context) override
148 {

Callers

nothing calls this directly

Calls 2

StopProduceMethod · 0.80
enqueueMethod · 0.45

Tested by

no test coverage detected