| char *_threadexitsallstatus; |
| Channel *_threadwaitchan; |
| threadexits(char *exitstr) |
| _threaddebug(DBGSCHED, "threadexits %s", exitstr); |
| utfecpy(p->exitstr, p->exitstr+ERRMAX, exitstr); |
| threadexitsall(char *exitstr) |
| _threaddebug(DBGSCHED, "threadexitsall %s", exitstr); |
| _threadexitsallstatus = exitstr; |
| _threaddebug(DBGSCHED, "_threadexitsallstatus set to %p", _threadexitsallstatus); |
| * copying all the pids first avoids other thread's |
| * teardown procedures getting in the way. |
| for(p=_threadpq.head; p; p=p->next) |
| pid = _threadmalloc(npid*sizeof(pid[0]), 0); |
| for(p = _threadpq.head; p; p=p->next) |
| _threaddebug(DBGSCHED, "threadexitsall kill %d", pid[i]); |
| if(pid[i]==0 || pid[i]==-1) |
| fprint(2, "bad pid in threadexitsall: %d\n", pid[i]); |
| _threadwaitchan = chancreate(sizeof(Waitmsg*), 16); |