File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -232,12 +232,13 @@ namespace timestudy {
232232 return true ;
233233 }
234234 // every running stream is now waiting
235- return waitingStreams_.size () == activeStreams_;
235+ return waitingStreams_.size () > 0 and waitingStreams_. size () == activeStreams_;
236236 }
237237
238238 void threadWork () {
239239 while (not stopProcessing_.load ()) {
240240 std::vector<int > streamsToProcess;
241+ streamsToProcess.reserve (waitingStreams_.capacity ());
241242 {
242243 std::unique_lock<std::mutex> lk (mutex_);
243244 condition_.wait (lk, [this ]() { return readyToDoSomething (); });
@@ -266,6 +267,7 @@ namespace timestudy {
266267 }
267268 }
268269 waitingTaskPerStream_.clear ();
270+ waitingTaskPerStream_.resize (waitingTaskPerStream_.capacity ());
269271 }
270272 const unsigned int nWaitingEvents_;
271273 std::unique_ptr<std::thread> serverThread_;
You can’t perform that action at this time.
0 commit comments