/* 
 * test.c
 *
 * x-kernel v3.3
 *
 * Copyright (c) 1993,1991,1990,1996  Arizona Board of Regents
 */

typedef struct {
  void (*func)(void *);
  void *arg;
} StubArg;

void stub (void *arg)
{
  void (*f)(void *);
  f = (StubArg *)arg->func;

  f((StubArg*)arg->arg);

  threadStop();
}

void create_thread (void (*func)(void *), void *arg)
{
  StubArg s;
  s.func = func;
  s.arg = arg;

  t = threadCreate (stub, &s);
  threadWakeup (t);
}
