#include <nitro/os.h>
typedef void (*OSSwitchThreadCallback)(
OSThread* from,
OSThread* to );
OSSwitchThreadCallback OS_SetSwitchThreadCallback(
OSSwitchThreadCallback callback );
callback | The callback used when threads are switched. Specify NULL to release callback. |
The callback that was specified before this function was called. If none was set, returns NULL.
This function registers the callback function that is used when a thread context switch is generated.
Once this callback function is registered, unless it is modified or released, it will be called each time a context switch is generated.
callback
takes 2 arguments. from
is a pointer to the OSThread
structure of the thread that was being executed before the switch. to
is a pointer to the OSThread
structure of the thread that will be executed next. If it is not prepared to execute, this will be NULL.
OS_InitThread, OS_RescheduleThread
2004/03/31 Initial version.
CONFIDENTIAL