Exemplo n.º 1
0
void get_randoms(int amount, channel<int>& c) {
	int total = 0;
	for (int i=0; i<amount-1; i++) {
		total += c.recv();
	}
	std::cout << "[" << std::this_thread::get_id() << "] total is " << total << "\n";
}