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

Method thread

tests/relacy/integrated.cpp:581–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

579 }
580
581 void thread(unsigned int tid)
582 {
583 RelacyThreadExitNotifier::notify_relacy_thread_start();
584
585 if (tid == 0) {
586 ProducerToken t(*q);
587 for (int i = 0; i != (int)seen.size(); ++i) {
588 q->enqueue(t, Foo(i));
589 }
590 }
591 else {
592 Foo item;
593 ConsumerToken t(*q);
594 for (int i = rl::rand(17); i > 0; --i) {
595 if (q->try_dequeue(t, item)) {
596 RL_ASSERT(!seen[item.id]);
597 seen[item.id] = true;
598 }
599 }
600 }
601
602 RelacyThreadExitNotifier::notify_relacy_thread_exit();
603 }
604
605 void after()
606 {

Callers

nothing calls this directly

Calls 5

randFunction · 0.85
FooClass · 0.70
sizeMethod · 0.45
enqueueMethod · 0.45
try_dequeueMethod · 0.45

Tested by

no test coverage detected