From: Alan Cox Date: Tue, 19 May 2015 21:20:42 +0000 (+0100) Subject: process: update comments on reviewed FIXME X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=fc8302d8243ead1ff658095bd85c407d0a9ea22d;p=FUZIX.git process: update comments on reviewed FIXME --- diff --git a/Kernel/process.c b/Kernel/process.c index 3600afed..14749626 100644 --- a/Kernel/process.c +++ b/Kernel/process.c @@ -40,8 +40,11 @@ void psleep(void *event) udata.u_ptab->p_waitno = ++waitno; nready--; - /* FIXME: we don't want to restore interrupts here, but what - is the consequence */ + /* It is safe to restore interrupts here. We have already updated the + process state. The worst case is that a wakeup as we switchout + leads us to switch out and back in, or that we wake and run + after other candidates - no different to it occuring after the + switch */ irqrestore(irq); switchout(); /* Switch us out, and start another process */ /* Switchout doesn't return in this context until we have been switched back in, of course. */