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

Method thread

tests/relacy/integrated.cpp:242–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240 }
241
242 void thread(unsigned int tid)
243 {
244 RelacyThreadExitNotifier::notify_relacy_thread_start();
245
246 if (tid == 0) {
247 ProducerToken t(q);
248 for (int i = 0; i != 12; ++i) {
249 q.enqueue(t, i);
250 }
251 }
252 else {
253 int item;
254 ConsumerToken t(q);
255 for (int i = 0; i != 3; ++i) {
256 if (q.try_dequeue(t, item)) {
257 RL_ASSERT(!seen[item]);
258 seen[item] = true;
259 }
260 }
261 }
262
263 RelacyThreadExitNotifier::notify_relacy_thread_exit();
264 }
265
266 void after()
267 {

Callers

nothing calls this directly

Calls 2

enqueueMethod · 0.45
try_dequeueMethod · 0.45

Tested by

no test coverage detected