diff --git a/task.c b/task.c index 85b0f2f9..96558ca2 100644 --- a/task.c +++ b/task.c @@ -304,12 +304,14 @@ int TaskYield(pTaskMan self) int TaskSignal(pTaskMan self, int iSignal, void *pSigData) { pTaskHead pTemp, pEnd; + int myStatus = self->pCurrent->iStatus; assert(self); assert(self->iID == TASKERID); /* Do one cycle until we are at the caller, then return to him */ pEnd = self->pCurrent; + pEnd->iStatus = WAITING; IncrTaskPointer(self); while (self->pCurrent != pEnd) { if (self->pCurrent->pSignal) { @@ -318,6 +320,7 @@ int TaskSignal(pTaskMan self, int iSignal, void *pSigData) IncrTaskPointer(self); } /* finally, tell me about the thingie as well */ + pEnd->iStatus = myStatus; if (pEnd->pSignal) { pEnd->pSignal(pEnd->pData, iSignal, pSigData); }