- allow scriptcontext objects to be dynamic
- enhancements in scriptcontext (error messages stored as properties)
This commit is contained in:
27
task.c
27
task.c
@ -344,3 +344,30 @@ int TaskContinue(pTaskMan self)
|
||||
self->iStop = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
void TaskRemove(pTaskMan self, TaskFunc pTaskRun, void *pData)
|
||||
{
|
||||
int iRet;
|
||||
pTaskHead pCurrent, pNext;
|
||||
|
||||
assert(self);
|
||||
assert(self->iID == TASKERID);
|
||||
|
||||
pNext = self->pHead->pNext; /* skip dummy task */
|
||||
while (pNext != NULL) {
|
||||
pCurrent = pNext;
|
||||
pNext = pCurrent->pNext;
|
||||
if (pCurrent->pRun == pTaskRun && pCurrent->pData == pData) {
|
||||
/* unlink */
|
||||
if (pCurrent->pPrevious != NULL) {
|
||||
pCurrent->pPrevious->pNext = pCurrent->pNext;
|
||||
}
|
||||
if (pCurrent->pNext != NULL) {
|
||||
pCurrent->pNext->pPrevious = pCurrent->pPrevious;
|
||||
}
|
||||
free(pCurrent);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user