#define NUM_THREAD 8
#define NLOOP 10000
spThreadReturn thread(void *data)
{
int n;
int *thread_index = (int *)data;
for (n = 0; n < NLOOP; n++) {
printf("thread %d: n = %d\n", *thread_index, n);
}
printf("thread %d done\n", *thread_index);
return SP_THREAD_RETURN_SUCCESS;
}
int main(int argc, char *argv[])
{
int i;
int thread_indexes[NUM_THREAD];
void *hthreads[NUM_THREAD];
for (i = 0; i < NUM_THREAD; i++) {
thread_indexes[i] = i;
}
for (i = 0; i < NUM_THREAD; i++) {
printf("wait thread %d...\n", i);
printf("wait thread %d done\n", i);
}
printf("done\n");
return 0;
}
void * spCreateThread(long stacksize, int priority, spThreadFunc func, void *data)
long spWaitThread(void *handle)