Originally Posted by
bithub
In addition to what carrotcake said, your ping() and pong() functions should return values.
actually, if they're thread procedures, they should call
Code:
pthread_exit(NULL);
instead of returning. granted, they should still have a return statement for standards-compliance, but in order to behave as expected, you really need to have the pthread_exit call.
edit: when creating your threads, you should not put the '&' symbol in front of the function names.
Code:
pthread_create(&t1, NULL, pong, NULL);
is the correct usage. putting the '&' in front of the function names will likely result in compiler errors.