mypid = getpid(); /* * signal others. * copying all the pids first avoids other thread's * teardown procedures getting in the way. */ lock(&_threadpq.lock); npid = 0; for(p=_threadpq.head; p; p=p->next) npid++; pid = _threadmalloc(npid*sizeof(pid[0]), 0); npid = 0; for(p = _threadpq.head; p; p=p->next) pid[npid++] = p->pid; unlock(&_threadpq.lock); for(i=0; i