#define _REENTRANT /* basic 3-lines for threads */
#include
#include
#include
void *odd(void *); /* thread routine */
void *even(void *); /* thread routine */
int
main(int argc, char *argv[] )
{
int i, *ip;
int count;
thread_t *tid; /* array of thread IDs */
if (argc != 2) {
printf("Usaget_thread_r [count]\n");
return (1);
}
if((count = atoi(argv[1])) == 0)
{
puts("argv[1] is 0 or Input Error\n");
return(0);
}
if((tid = (thread_t *) malloc(sizeof(thread_t)*count)) == NULL)