MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / thread

Method thread

tests/relacy/integrated.cpp:190–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188 }
189
190 void thread(unsigned int tid)
191 {
192 RelacyThreadExitNotifier::notify_relacy_thread_start();
193
194 if (tid == 0) {
195 ProducerToken t(q);
196 for (int i = 0; i != 8; ++i) {
197 q.enqueue(t, i);
198 }
199 }
200 else {
201 int item;
202 ConsumerToken t(q);
203 for (int i = 0; i != 6; ++i) {
204 if (q.try_dequeue(t, item)) {
205 RL_ASSERT(!seen[item]);
206 seen[item] = true;
207 }
208 }
209 }
210
211 RelacyThreadExitNotifier::notify_relacy_thread_exit();
212 }
213
214 void after()
215 {

Callers

nothing calls this directly

Calls 2

enqueueMethod · 0.45
try_dequeueMethod · 0.45

Tested by

no test coverage detected