Ejemplo n.º 1
0
/**
 * Purges Tasks where this component is scheduler or schedulee from the TaskQueue.
 */
void purgeTasks (void *comp) {
#ifdef MULTI_MONKS
	pthread_mutex_lock(&task_mutex);
#endif

	Task *T = taskQueue;
	Task **temp = &taskQueue;
	uint8_t i = 0;
	while(T != NULL) {
		if(T->schedulee == comp || T->scheduler == comp) {
			Log(LOG_SCHEDULER, "[pT] id %x\n", T->identifier);
			i ++;
			*temp = T->next;
			returnMessage((Message *) T->context);
			taskCompleted(T);
			T = *temp;
		}
		else {
			temp = &(T->next);
			T = T->next;
		}
	}

#ifdef MULTI_MONKS
	pthread_mutex_unlock(&task_mutex);
#endif
}
Ejemplo n.º 2
0
/**
  * Appelé à la fin de conversion d'une image
  */
void Converter::convertFinished()
{
    _countFinished++;
    emit imageHasFinished(_countFinished);
    if (_count < _list.size())
    {
        launchProcess(_list[_count],_size);
        _count++;
    }
    if (_countFinished == _list.size())
    {
        emit taskCompleted();
    }
}
Ejemplo n.º 3
0
void executeTasks () {
	Task *toExecute = retrieveTask();
	Log(LOG_SCHEDINTF, "[executeTasks] Start\n");
	while(toExecute != NULL) {

		Log(LOG_SCHEDINTF, "[executeTasks] Executing a task\n");

		toExecute->function(toExecute->schedulee, toExecute->context, toExecute->scheduler);
		returnMessage(toExecute->context);
		taskCompleted(toExecute);

		Log(LOG_SCHEDINTF, "[executeTasks] Task execution done\n");

		toExecute = retrieveTask();
	}

	Log(LOG_SCHEDINTF, "[executeTasks] End\n");

}
Ejemplo n.º 4
0
AnalyzeTask::~AnalyzeTask(void)
{
	emit taskCompleted(m_taskId);
}