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

Method thread

tests/relacy/integrated.cpp:643–663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

641 }
642
643 void thread(unsigned int tid)
644 {
645 RelacyThreadExitNotifier::notify_relacy_thread_start();
646
647 if (tid == 0) {
648 for (int i = 0; i != (int)seen.size(); ++i) {
649 q->enqueue(Foo(i));
650 }
651 }
652 else {
653 Foo item;
654 for (int i = rl::rand(17); i > 0; --i) {
655 if (q->try_dequeue(item)) {
656 RL_ASSERT(!seen[item.id]);
657 seen[item.id] = true;
658 }
659 }
660 }
661
662 RelacyThreadExitNotifier::notify_relacy_thread_exit();
663 }
664
665 void after()
666 {

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