1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 9<title>OSSetSwitchThreadCallback</title> 10</head> 11 12<body> 13 14<h1>OSSetSwitchThreadCallback</h1> 15 16<h2>Syntax</h2> 17<dl><dd><pre class="construction"> 18#include <revolution/os.h> 19 20typedef void (*OSSwitchThreadCallback)(OSThread* from, OSThread* to); 21 22OSSwitchThreadCallback 23 OSSetSwitchThreadCallback( OSSwitchThreadCallback callback ); 24</pre></dd></dl> 25 26<h2>Arguments</h2> 27<TABLE class="arguments" border="1" > 28 <tr> 29<TH>callback</TH> 30<TD>Callback function to call whenever a thread context switch occurs. Specify <code>NULL</code> to unregister the callback function.</TD> 31 </tr> 32</TABLE> 33 34<h2>Return Values</h2> 35<P>The previous thread switch callback.</P> 36 37<h2>Description</h2> 38<P>Registers a specified callback function. This callback function is called whenever a thread context switch occurs.</P> 39<P><SPAN class="argument">callback</SPAN> takes 2 arguments. <SPAN class="argument">from</SPAN> is a pointer to the previously running thread. <SPAN class="argument">to</SPAN> is a pointer to the next running thread. If there is no thread ready to run, either <SPAN class="argument">from</SPAN> or <SPAN class="argument">to</SPAN> will be <CODE>NULL</CODE>.</P> 40 41<h2>See Also</h2> 42<P class="reference"> 43<a href="../toc.html#Thread" target="contents">Thread Functions</a>, 44<a href="../toc.html#ThreadSynchronization" target="contents">Thread Synchronization Functions</a>, 45<a href="OSCancelThread.html">OSCancelThread</a>, 46<a href="OSDetachThread.html">OSDetachThread</a>, 47<a href="OSExitThread.html">OSExitThread</a>, 48<a href="OSIsThreadTerminated.html">OSIsThreadTerminated</a> 49</p> 50 51<H2>Revision History</H2> 52<P> 532006/03/01 Initial version.<br> 54</P> 55 56<hr><p>CONFIDENTIAL</p></body> 57</html>