Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. CommandsProcessor(size_t countsOfThreads) {
  2.         isInputStreamOver = false;
  3.         commandsQueue = std::make_shared<std::queue<std::vector<std::string>>>(std::queue<std::vector<std::string>>{});
  4.         countOfWorkingThreads = countsOfThreads;
  5.         workers.reserve(countsOfThreads);
  6.         for (size_t i = 0; i < countsOfThreads; i++) {
  7.             IOFstreams.emplace_back(commandsQueue);
  8.             workers.emplace_back(&OFThread::outputToFile, &IOFstreams[i]);
  9.         }
  10.     }
  11. CommandsProcessor(size_t countsOfThreads) {
  12.         isInputStreamOver = false;
  13.         commandsQueue = std::make_shared<std::queue<std::vector<std::string>>>(std::queue<std::vector<std::string>>{});
  14.         countOfWorkingThreads = countsOfThreads;
  15.         workers.reserve(countsOfThreads);
  16.         for (size_t i = 0; i < countsOfThreads; i++) {
  17.             IOFstreams.emplace_back(commandsQueue);
  18.         }
  19.         for (size_t i = 0; i < countsOfThreads; i++) {
  20.             workers.emplace_back(&OFThread::outputToFile, &IOFstreams[i]);
  21.         }
  22.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement