/* main2.cc This is a simple test program that will demonstrate how problems may arise in concurrent programming. */ #include #include // Declare a global int that will cause us all sorts of problems int counter = 0; void* Thread_1(void* Argument); void* Thread_2(void* Argument); int main() { pthread_t first_thread, second_thread; pthread_create(&first_thread, NULL, Thread_1, NULL); pthread_create(&second_thread, NULL, Thread_2, NULL); pthread_join(first_thread, NULL); pthread_join(second_thread, NULL); cout<<"counter is:"<