i just modified _schedexecwait to not eat wait messages.

i think that if you're asynchronously procexecing() and
waiting for wait messages, some could have been lost.

have i missed something?  this seems too basic.

- erik
---

void
_schedexecwait(void)
{
        int pid;
        Channel *c;
        Proc *p;
        Thread *t;
        Waitmsg *w;

        p = _threadgetproc();
        t = p->thread;
        pid = t->ret;
        _threaddebug(DBGEXEC, "_schedexecwait %d", t->ret);

        rfork(RFCFDG);
        for(;;){
                w = wait();
                if(w == nil)
                        break;
                if(w->pid == pid)
                        break;
++              if((c = _threadwaitchan) != nil)
++                      sendp(c, w);
++              else
                        free(w);
        }
        if(w != nil){
                if((c = _threadwaitchan) != nil)
                        sendp(c, w);
                else
                        free(w);
        }
        threadexits("procexec");
}

Reply via email to