#include <stdio.h>
#include <thread.h>

#define BOUND 100000 /* number of integers being printed by each thread */

thread_t one;        /* thread that prints ones */
thread_t two;        /* thread that prints twos */

/* 
 * Prints the specified integer BOUND times.
 */
void *print(void *arg)
{
  int i;
  for(i = 0; i < BOUND; i++)
  {
    printf("%d", (int) arg);
  }
}

main()
{
  thr_create(NULL, NULL, print, (void *) 1, NULL, &one);
  thr_create(NULL, NULL, print, (void *) 2, NULL, &two);
  while (thr_join(NULL, NULL, NULL) == 0);
}

