示例#1
0
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;
}
示例#2
0
文件: step_thread.c 项目: KurSh/rr
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;
}