void run () {
			while (!queue.empty()) {
				std::shared_ptr<Runnable*> runnable = queue.wait_and_pop();
				Runnable *executable =*runnable.get();
				std::thread t1(&Runnable::operator(),executable);
				threads.push_back(std::move(t1));
			}
		}
Ejemplo n.º 2
0
void send_thread(){
	int i = 0;
	while(i<50){
		std::string s;
		squeue.wait_and_pop(s);
		std::cout<<s<<std::endl;
		i++;
	}
}
Ejemplo n.º 3
0
void data_processing_thread()
{
    while(true)
    {
        data_chunk data;
        data_queue.wait_and_pop(data);
        process(data);
        if(is_last_chunk(data))
            break;
    }
}