OSSetSwitchThreadCallback

C Specification

#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 cancel 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 two arguments. from is a pointer to the previously running thread. to is a pointer to the next running thread. If no thread is ready to run, either from or to will be NULL.

See Also

Thread Functions, Thread Synchronization Functions, OSCancelThreadOSDetachThreadOSExitThreadOSIsThreadTerminated

Revision History

03/01/2006 Initial version.