| 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 | { |
nothing calls this directly
no test coverage detected