#include <iostream>
#include <boost/thread.hpp>
#include <boost/thread/mutex.hpp>
using namespace std;
using namespace boost;
boost::barrier sync_point(3);

void worker(int id){
	cout <<"thread: "<< id <<"before barrier" <<endl;
	this_thread::sleep_for(boost::chrono::milliseconds(1000));
	cout <<"thread: "<< id <<"waiting at barrier" <<endl;
	sync_point.wait();
	cout <<"thread: "<<id <<"passed barrier"<<endl;

}

int main(){

	thread t1(worker,1);
	thread t2(worker,2);
	thread t3(worker,3);

	t1.join();
	t2.join();
	t3.join();


return 0;
}
