OSSetSwitchThreadCallback

Syntax

#include <revolution/os.h>

typedef void (*OSSwitchThreadCallback)(OSThread* from, OSThread* to);

OSSwitchThreadCallback 
    OSSetSwitchThreadCallback( OSSwitchThreadCallback callback );

Arguments

callback Callback function to call whenever a thread context switch occurs. Specify NULL to unregister the callback function.

Return Values

The previous thread switch callback.

Description

Registers a specified callback function. This callback function is called whenever a thread context switch occurs.

callback takes 2 arguments. from is a pointer to the previously running thread. to is a pointer to the next running thread. If there is no thread ready to run, either from or to will be NULL.

See Also

Thread Functions, Thread Synchronization Functions, OSCancelThread, OSDetachThread, OSExitThread, OSIsThreadTerminated

Revision History

2006/03/01 Initial version.


CONFIDENTIAL