remove one (obsolete) readyqueue

priority 0 is only used by the idle task and doesn't need own queue
=> reduce the number of queues
This commit is contained in:
Stefan Lankes 2013-11-22 19:56:59 +01:00
parent fea9e78f32
commit e3ba77995c
2 changed files with 3 additions and 2 deletions

View file

@ -94,7 +94,7 @@ typedef struct {
/// indicates the used priority queues
uint32_t prio_bitmap;
/// a queue for each priority
task_list_t queue[MAX_PRIO];
task_list_t queue[MAX_PRIO-1];
} readyqueues_t;
#ifdef __cplusplus

View file

@ -42,7 +42,7 @@ static task_t task_table[MAX_TASKS] = { \
[0] = {0, TASK_IDLE, NULL, NULL, 0, NULL, NULL}, \
[1 ... MAX_TASKS-1] = {0, TASK_INVALID, NULL, NULL, 0, NULL, NULL}};
static readyqueues_t readyqueues = { task_table+0, NULL, 0, 0, {[0 ... MAX_PRIO-1] = {NULL, NULL}}};
static readyqueues_t readyqueues = { task_table+0, NULL, 0, 0, {[0 ... MAX_PRIO-2] = {NULL, NULL}}};
task_t* current_task = task_table+0;
@ -219,6 +219,7 @@ size_t** scheduler(void)
current_task->status = TASK_RUNNING;
// remove new task from queue
// by the way, priority 0 is only used by the idle task and doesn't need own queue
readyqueues.queue[prio-1].first = current_task->next;
if (!current_task->next) {
readyqueues.queue[prio-1].last = NULL;