1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
rc = pthread_create(&thread_one, NULL, TaskCode, (void *) &thread_one_args);
assert(rc==0);
rc = pthread_create(&thread_two, NULL, TaskCode, (void *) &thread_two_args);
assert(rc==0);
rc = pthread_create(&thread_three, NULL, TaskCode, (void *) &thread_three_args);
assert(rc==0);
rc = pthread_create(&thread_four, NULL, TaskCode, (void *) &thread_four_args);
assert(rc==0);
rc = pthread_join(thread_one, NULL);
assert(0 == rc);
rc = pthread_join(thread_two, NULL);
assert(0 == rc);
rc = pthread_join(thread_three, NULL);
assert(0 == rc);
rc = pthread_join(thread_four, NULL);
assert(0 == rc);
| |