KallistiOS git master
Independent SDK for the Sega Dreamcast
|
Low-level thread sleeping More...
Functions | |
void | timer_spin_sleep (int ms) |
Spin-loop sleep function. | |
void | timer_spin_delay_us (unsigned short us) |
Spin-loop delay function with microsecond granularity. | |
void | timer_spin_delay_ns (unsigned short ns) |
Spin-loop delay function with nanosecond granularity. | |
Low-level thread sleeping
This API provides the low-level functionality used to implement thread sleeping, used by the KOS, C, C++, and POSIX threading APIs.
void timer_spin_delay_ns | ( | unsigned short | ns | ) |
Spin-loop delay function with nanosecond granularity.
This function is meant as a very accurate delay function, even if threading and interrupts are disabled. It is a delay and not a sleep, which means that the CPU will be busy-looping during that time frame.
ns | The number of nanoseconds to wait for. |
void timer_spin_delay_us | ( | unsigned short | us | ) |
Spin-loop delay function with microsecond granularity.
This function is meant as a very accurate delay function, even if threading and interrupts are disabled. It is a delay and not a sleep, which means that the CPU will be busy-looping during that time frame. For any time frame bigger than a few hundred microseconds, it is recommended to sleep instead.
us | The number of microseconds to wait for. |
void timer_spin_sleep | ( | int | ms | ) |
Spin-loop sleep function.
This function is meant as a very accurate delay function, even if threading and interrupts are disabled. It uses TMU1 to sleep.
ms | The number of milliseconds to sleep. |