MCPcopy Create free account
hub / github.com/catboost/catboost / Run

Method Run

util/thread/lfstack_ut.cpp:88–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) {

Callers 1

Y_UNIT_TESTFunction · 0.45

Calls 5

push_backMethod · 0.45
clearMethod · 0.45
loadMethod · 0.45
DequeueAllMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected