/* Thread itself. */ typedefstruct _thread { unsignedlong id; unsignedchar type; /* thread type */ struct _thread *next;/* next pointer of the thread */ struct _thread *prev;/* previous pointer of the thread */ struct _thread_master *master;/* pointer to the struct thread_master. */ int (*func) (struct _thread *); /* event function */ void *arg; /* event argument */ TIMEVAL sands; /* rest of time sands value. */ union { int val; /* second argument of the event. */ int fd; /* file descriptor in case of read/write. */ struct { pid_t pid; /* process id a child thread is wanting. */ int status; /* return status of the process */ } c; } u; } thread;