void pqPush(PayQueue pq, Payload pld) { Payload pay; if (queueIsFull(pq)) { pay = (Payload)queuePop(pq); payDelete(pay); } queueAppend(pq, pld); }
/* * Coloca a thread numa das filas de STATE_READYs. * Caso a prioridade da thread seja inválida, o programa * é abortado. */ void putInReadyState(s_tcb *thread) { s_queue *queue; queue = getReadyQueue(thread->prio); if(queue == NULL) { printf("Erro fatal em putInReadyState: prioridade inválida\n"); exit(-1); } thread->state = STATE_READY; queueAppend(queue, thread); }