62,11 → 62,13 |
timeout_t *h; |
timeout_handler_t f; |
void *arg; |
int i; |
|
/* |
* To avoid lock ordering problems, |
* run all expired timeouts as you visit them. |
*/ |
for (i = 0; i < CPU->missed_clock_ticks; i++) { |
spinlock_lock(&CPU->timeoutlock); |
while ((l = CPU->timeout_active_head.next) != &CPU->timeout_active_head) { |
h = list_get_instance(l, timeout_t, link); |
87,6 → 89,8 |
spinlock_lock(&CPU->timeoutlock); |
} |
spinlock_unlock(&CPU->timeoutlock); |
} |
CPU->missed_clock_ticks = 0; |
|
/* |
* Do CPU usage accounting and find out whether to preempt THREAD. |