Lines Matching refs:queue
23 WorkQueue<int>* queue; member
29 while (queue->pop(result)) { in operator ()()
38 WorkQueue<int> queue; in TEST() local
41 queue.push(5); in TEST()
42 EXPECT_TRUE(queue.pop(result)); in TEST()
45 queue.push(1); in TEST()
46 queue.push(2); in TEST()
47 EXPECT_TRUE(queue.pop(result)); in TEST()
49 EXPECT_TRUE(queue.pop(result)); in TEST()
52 queue.push(1); in TEST()
53 queue.push(2); in TEST()
54 queue.finish(); in TEST()
55 EXPECT_TRUE(queue.pop(result)); in TEST()
57 EXPECT_TRUE(queue.pop(result)); in TEST()
59 EXPECT_FALSE(queue.pop(result)); in TEST()
61 queue.waitUntilFinished(); in TEST()
65 WorkQueue<int> queue; in TEST() local
69 queue.push(int{i}); in TEST()
72 std::thread thread([ &queue, max ] { in TEST()
75 if (!queue.pop(result)) { in TEST()
85 queue.push(int{i}); in TEST()
87 queue.finish(); in TEST()
93 WorkQueue<int> queue; in TEST() local
98 threads.emplace_back(Popper{&queue, results.data(), &mutex}); in TEST()
102 queue.push(int{i}); in TEST()
104 queue.finish(); in TEST()
116 WorkQueue<int> queue; in TEST() local
121 popperThreads.emplace_back(Popper{&queue, results.data(), &mutex}); in TEST()
129 [ &queue, min, max ] { in TEST()
131 queue.push(int{i}); in TEST()
139 queue.finish(); in TEST()
151 WorkQueue<int> queue(1); in TEST() local
153 queue.push(5); in TEST()
154 queue.pop(result); in TEST()
155 queue.push(5); in TEST()
156 queue.pop(result); in TEST()
157 queue.push(5); in TEST()
158 queue.finish(); in TEST()
159 queue.pop(result); in TEST()
164 WorkQueue<int> queue(1); in TEST() local
166 queue.push(5); in TEST()
167 std::thread pusher([&queue] { in TEST()
168 queue.push(6); in TEST()
172 queue.finish(); in TEST()
173 EXPECT_TRUE(queue.pop(result)); in TEST()
175 EXPECT_FALSE(queue.pop(result)); in TEST()
181 WorkQueue<int> queue(2); in TEST() local
183 queue.push(5); in TEST()
184 queue.push(6); in TEST()
185 queue.setMaxSize(1); in TEST()
186 std::thread pusher([&queue] { in TEST()
187 queue.push(7); in TEST()
191 queue.finish(); in TEST()
192 EXPECT_TRUE(queue.pop(result)); in TEST()
194 EXPECT_TRUE(queue.pop(result)); in TEST()
196 EXPECT_FALSE(queue.pop(result)); in TEST()
202 WorkQueue<int> queue(10); in TEST() local
208 popperThreads.emplace_back(Popper{&queue, results.data(), &mutex}); in TEST()
217 [ &queue, min, max ] { in TEST()
219 queue.push(int{i}); in TEST()
229 queue.finish(); in TEST()
243 WorkQueue<std::unique_ptr<int>> queue; in TEST() local
245 EXPECT_TRUE(queue.push(std::move(x))); in TEST()
247 queue.finish(); in TEST()
249 EXPECT_FALSE(queue.push(std::move(x))); in TEST()
256 BufferWorkQueue queue; in TEST() local
257 queue.finish(); in TEST()
258 EXPECT_EQ(0, queue.size()); in TEST()
261 BufferWorkQueue queue; in TEST() local
262 queue.push(Buffer(10)); in TEST()
263 queue.finish(); in TEST()
264 EXPECT_EQ(10, queue.size()); in TEST()
267 BufferWorkQueue queue; in TEST() local
268 queue.push(Buffer(10)); in TEST()
269 queue.push(Buffer(5)); in TEST()
270 queue.finish(); in TEST()
271 EXPECT_EQ(15, queue.size()); in TEST()
274 BufferWorkQueue queue; in TEST() local
275 queue.push(Buffer(10)); in TEST()
276 queue.push(Buffer(5)); in TEST()
277 queue.finish(); in TEST()
279 queue.pop(buffer); in TEST()
280 EXPECT_EQ(5, queue.size()); in TEST()