#include <iostream>
#include <boost/thread.hpp>
#include <boost/chrono.hpp>

using namespace boost;
using namespace std;

void mw(int tid, int *p){
	cout << "Hello from thread" << this_thread::get_id() << ":" << tid << endl;
	for (int i=0;i<10;i++){
		cout << "thread" << tid << ":p[" << i << "]=" << *p << endl;
		p++;
	}
}

void mw2(int tid, int *p){
	cout << "Hello from thread" << this_thread::get_id() << ":" << tid << endl;
	for (int i=0;i<10;i++){
		cout << "thread" << tid << ":p[" << i << "]=" << *p << endl;
		p++;
	}
}

int main(){
	int *a = new int[10];
	int count = 1;
	for (int i=0; i<10;i++)
		a[i]=i;
	thread *t1 = new thread(mw, count, a);
	count++;
	thread *t2 = new thread(mw2, count, a);

	t1->join();
	t2->join();

	return 0;
}
