Changeset 3948 for trunk/test/queue.cc


Ignore:
Timestamp:
Jul 20, 2020, 9:12:46 AM (3 years ago)
Author:
Peter
Message:

replace boost::thread with std::thread in Scheduler. refs #953

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/queue.cc

    r3062 r3948  
    2626#include "yat/utility/Queue.h"
    2727
    28 #include <boost/thread.hpp>
    29 
    3028#include <iostream>
     29#include <thread>
     30#include <vector>
    3131
    3232using namespace theplu::yat;
     
    5050      }
    5151      sleep(1);
    52       // Make sure we can be interrupted
    53       boost::this_thread::interruption_point();
    5452    }
    5553  }
     
    6563  queue.push("Peter");
    6664
    67   boost::thread_group workers;
    68   workers.create_thread(Worker(queue));
    69   workers.create_thread(Worker(queue));
    70   workers.create_thread(Worker(queue));
    71   workers.create_thread(Worker(queue));
     65  std::vector<std::thread> threads;
     66  threads.push_back(std::thread(Worker(queue)));
     67  threads.push_back(std::thread(Worker(queue)));
     68  threads.push_back(std::thread(Worker(queue)));
     69  threads.push_back(std::thread(Worker(queue)));
    7270
    73   workers.join_all();
     71  for (size_t i=0; i<threads.size(); ++i)
     72    threads[i].join();
    7473
    7574  Queue<std::string> queue2(queue);
Note: See TracChangeset for help on using the changeset viewer.