Implement task priorities and message queues
This commit is contained in:
@ -28,6 +28,7 @@ static void KillBckTask(void *data)
|
||||
if (self->command) {
|
||||
free(self->command);
|
||||
}
|
||||
free(self);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
@ -44,6 +45,7 @@ static int BackgroundTask(void *data)
|
||||
/*----------------------------------------------------------------------------*/
|
||||
int BackgroundCommand(SConnection * pCon, char *command)
|
||||
{
|
||||
long lID;
|
||||
pBckTask self = NULL;
|
||||
|
||||
self = calloc(1, sizeof(BckTask));
|
||||
@ -58,7 +60,8 @@ int BackgroundCommand(SConnection * pCon, char *command)
|
||||
return 0;
|
||||
}
|
||||
|
||||
TaskRegisterN(pServ->pTasker, self->command, BackgroundTask, NULL, KillBckTask, self, 1);
|
||||
lID = TaskRegisterN(pServ->pTasker, self->command, BackgroundTask, NULL, KillBckTask, self, TASK_PRIO_LOW);
|
||||
SCPrintf(pCon, eValue, "bg = %ld", lID);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -76,7 +79,6 @@ int BackgroundAction(SConnection * pCon, SicsInterp * pSics,
|
||||
SCWrite(pCon, "ERROR: out of memory starting task", eError);
|
||||
return 0;
|
||||
}
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user