| 86 | } |
| 87 | |
| 88 | void Run() { |
| 89 | TVector<TSimpleSharedPtr<NThreading::TLegacyFuture<>>> futures; |
| 90 | |
| 91 | for (size_t i = 0; i < EnqueueThreads; ++i) { |
| 92 | futures.push_back(new NThreading::TLegacyFuture<>(std::bind(&TDequeueAllTester<SingleConsumer>::Enqueuer, this))); |
| 93 | } |
| 94 | |
| 95 | for (size_t i = 0; i < DequeueThreads; ++i) { |
| 96 | futures.push_back(new NThreading::TLegacyFuture<>(std::bind(&TDequeueAllTester<SingleConsumer>::DequeuerAll, this))); |
| 97 | } |
| 98 | |
| 99 | // effectively join |
| 100 | futures.clear(); |
| 101 | |
| 102 | UNIT_ASSERT_VALUES_EQUAL(0, int(LeftToDequeue.load())); |
| 103 | |
| 104 | TVector<int> left; |
| 105 | Stack.DequeueAll(&left); |
| 106 | UNIT_ASSERT(left.empty()); |
| 107 | } |
| 108 | }; |
| 109 | |
| 110 | Y_UNIT_TEST(TestDequeueAll) { |
no test coverage detected