示例#1
0
文件: dbgLib.c 项目: phoboz/vmx
LOCAL void dbgTaskTyAbort(
    void
    )
{
    /* Temprary remove abort function */
    tyAbortFuncSet((FUNCPTR) NULL);

    /* Flush standard I/O */
    ioctl(STDIN_FILENO, FIOFLUSH, 0);
    ioctl(STDOUT_FILENO, FIOFLUSH, 0);
    ioctl(STDERR_FILENO, FIOFLUSH, 0);

    /* If shell restart fails */
    if (taskRestart(shellTaskId) != OK)
    {
        fprintf(stderr, "spawning new shell.\n");

        /* Start a new shell */
        if (shellSpawn(0, (ARG) TRUE) != OK)
        {
            fprintf(stderr, "shell spawn failed.\n");
        }
    }
    else
    {
        fprintf(stderr, "%s restarted.\n", taskName(shellTaskId) );
    }

    /* Restore shell abort function */
    tyAbortFuncSet((FUNCPTR) dbgTyAbort);
}
示例#2
0
/*--------------------------------------------------------------*/
AupdtAA()
{
   char	msg4Aupdt[ 32 ];
   int msgesCount;
   int tid;
   if ((tid = taskNameToId("tAupdt")) != ERROR)
   {
	/* taskSuspend(tid); */
	msgesCount = cleanMsgesToAupdt();
	if ((pTheAcodeObject != NULL) && 
				(pTheAcodeObject->pAcodeControl != NULL))
	{
		semGive(pTheAcodeObject->pAcodeControl);
	}
	if (msgesCount > 0)
	{
	   sprintf( &msg4Aupdt[ 0 ], "0;" );
	   msgQSend(pMsgesToAupdt, &msg4Aupdt[ 0 ], 3, NO_WAIT, MSG_PRI_NORMAL);
        }
	taskRestart(tid);
   }
}
示例#3
0
文件: Task.cpp 项目: bescovedo/becode
/**
 * Restarts a running task.
 * If the task isn't started, it starts it.
 * @return false if the task is running and we are unable to kill the previous instance
 */
bool Task::Restart()
{
    return HandleError(taskRestart(m_taskID));
}