* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
/* decrement current time (we know it is >0 if it is
* in SCHEDULER_EVENT_ACTIVE state */
g_tab_event[i].current_time --;
/* decrement current time (we know it is >0 if it is
* in SCHEDULER_EVENT_ACTIVE state */
g_tab_event[i].current_time --;
/* time to schedule, but priority is too low,
* delay it */
if (g_tab_event[i].priority <= priority_running) {
/* time to schedule, but priority is too low,
* delay it */
if (g_tab_event[i].priority <= priority_running) {
/* harder : find the good place in list */
SLIST_FOREACH(e, &event_list, next) {
next_e = SLIST_NEXT(e, next);
/* harder : find the good place in list */
SLIST_FOREACH(e, &event_list, next) {
next_e = SLIST_NEXT(e, next);
g_tab_event[i].priority >= next_e->priority) {
SLIST_INSERT_AFTER(e, &g_tab_event[i], next);
break;
g_tab_event[i].priority >= next_e->priority) {
SLIST_INSERT_AFTER(e, &g_tab_event[i], next);
break;
/* end of schedule, mark it as active */
if (e->state == SCHEDULER_EVENT_SCHEDULED) {
e->state = SCHEDULER_EVENT_ACTIVE;
/* end of schedule, mark it as active */
if (e->state == SCHEDULER_EVENT_SCHEDULED) {
e->state = SCHEDULER_EVENT_ACTIVE;