1 #include "threadimpl.h"
4 char *_threadexitsallstatus;
5 Channel *_threadwaitchan;
8 threadexits(char *exitstr)
18 utfecpy(p->exitstr, p->exitstr+ERRMAX, exitstr);
23 threadexitsall(char *exitstr)
31 _threadexitsallstatus = exitstr;
32 _threaddebug(DBGSCHED, "_threadexitsallstatus set to %p", _threadexitsallstatus);
33 mypid = _threadgetpid();
37 * copying all the pids first avoids other threads
38 * teardown procedures getting in the way.
40 lock(&_threadpq.lock);
42 for(p=_threadpq.head; p; p=p->next)
44 pid = _threadmalloc(npid*sizeof(pid[0]), 0);
46 for(p = _threadpq.head; p; p=p->next)
48 unlock(&_threadpq.lock);
51 kill(pid[i], SIGTERM);
60 if(_threadwaitchan==nil)
61 _threadwaitchan = chancreate(sizeof(Waitmsg*), 16);
62 return _threadwaitchan;