equal
deleted
inserted
replaced
368 * for some time until we catch up. |
368 * for some time until we catch up. |
369 * This is undesirable, so we detect it by making sure the next_cycle will start in the future. |
369 * This is undesirable, so we detect it by making sure the next_cycle will start in the future. |
370 * When this happens we will switch from a purely periodic task _activation_ sequence, to a fixed task suspension interval. |
370 * When this happens we will switch from a purely periodic task _activation_ sequence, to a fixed task suspension interval. |
371 * |
371 * |
372 * NOTE B: |
372 * NOTE B: |
373 * It probably does not make sense to check for overflow of timer. |
373 * It probably does not make sense to check for overflow of timer - so we don't do it for now! |
374 * Even in 32 bit systems this will take at least 68 years since the computer booted |
374 * Even in 32 bit systems this will take at least 68 years since the computer booted |
375 * (remember, we are using CLOCK_MONOTONIC, which should start counting from 0 |
375 * (remember, we are using CLOCK_MONOTONIC, which should start counting from 0 |
376 * every time the system boots). On 64 bit systems, it will take over |
376 * every time the system boots). On 64 bit systems, it will take over |
377 * 10^11 years to overflow. |
377 * 10^11 years to overflow. |
378 */ |
378 */ |
383 /* Timer overflow. See NOTE B above */ |
383 /* Timer overflow. See NOTE B above */ |
384 ) { |
384 ) { |
385 next_cycle = now; |
385 next_cycle = now; |
386 timespec_add(next_cycle, period_sec, period_nsec); |
386 timespec_add(next_cycle, period_sec, period_nsec); |
387 } |
387 } |
|
388 |
388 clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &next_cycle, NULL); |
389 clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &next_cycle, NULL); |
389 } |
390 } |
390 |
391 |
391 // humour the compiler. |
392 // humour the compiler. |
392 return NULL; |
393 return NULL; |