int main() { pthread_t a, b; pthread_barrier_init(&bar, NULL, 3); pthread_create(&a, NULL, threadA, NULL); pthread_create(&b, NULL, threadB, NULL); C(); hit_barrier(); pthread_barrier_wait(&bar); pthread_join(a, NULL); pthread_join(b, NULL); return 0; }
int main(void) { void* dummy; pthread_t a, b; pthread_barrier_init(&bar, NULL, 3); dummy = pthread_create; dummy = pthread_barrier_wait; (void)dummy; ready(); pthread_create(&a, NULL, threadA, NULL); pthread_create(&b, NULL, threadB, NULL); C(); hit_barrier(); pthread_barrier_wait(&bar); pthread_join(a, NULL); pthread_join(b, NULL); return 0; }