mirror of https://github.com/zrafa/xinu-avr.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
499 B
20 lines
499 B
/* wakeup.c - wakeup */ |
|
|
|
#include <xinu.h> |
|
|
|
/*------------------------------------------------------------------------ |
|
* wakeup - Called by clock interrupt handler to awaken processes |
|
*------------------------------------------------------------------------ |
|
*/ |
|
void wakeup(void) |
|
{ |
|
/* Awaken all processes that have no more time to sleep */ |
|
|
|
resched_cntl(DEFER_START); |
|
while (nonempty(sleepq) && (firstkey(sleepq) <= 0)) { |
|
ready(dequeue(sleepq)); |
|
} |
|
|
|
resched_cntl(DEFER_STOP); |
|
return; |
|
}
|
|
|