4 #include "threadimpl.h"
7 char *_threadexitsallstatus;
8 Channel *_threadwaitchan;
11 threadexits(char *exitstr)
21 utfecpy(p->exitstr, p->exitstr+ERRMAX, exitstr);
26 threadexitsall(char *exitstr)
34 _threadexitsallstatus = exitstr;
35 _threaddebug(DBGSCHED, "_threadexitsallstatus set to %p", _threadexitsallstatus);
36 mypid = _tos->pid; //getpid();
40 * copying all the pids first avoids other threads
41 * teardown procedures getting in the way.
43 * avoid mallocs since malloc can post a note which can
44 * call threadexitsall...
47 lock(&_threadpq.lock);
49 for(p = _threadpq.head; p && npid < nelem(pid); p=p->next){
50 if(p->threadint == 0 && p->pid != mypid){
55 unlock(&_threadpq.lock);
59 postnote(PNPROC, pid[i], "threadint");
69 if(_threadwaitchan==nil)
70 _threadwaitchan = chancreate(sizeof(Waitmsg*), 16);
71 return _threadwaitchan;