Example #1
0
extern int
test_threads (void)
{
  pthread_t threads[NUMTH];
  pthread_barrier_t barrier;
  int i;

  pthread_barrier_init (&barrier, NULL, NUMTH + 1);

  for (i = 0; i < NUMTH; ++i)
    pthread_create (&threads[i], NULL, thread, &barrier);

  check_threads (&barrier);

  for (i = 0; i < NUMTH; ++i)
    pthread_join (threads[i], NULL);

  pthread_barrier_destroy (&barrier);

  return 0;
}
Example #2
0
	void Manager::on_thread_queue_w(ev::async &, int) {
		check_threads();
	}