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>OSSetThreadSpecific</title> 10</head> 11 12<body> 13 14<h1>OSGetThreadSpecific/OSSetThreadSpecific</h1> 15 16 17<h2>C Specification</h2> 18 19<dl> 20<dd><pre>#include <revolution/os.h> 21 22#define OS_THREAD_SPECIFIC_MAX 2 23 24void* OSGetThreadSpecific ( s32 index ); 25void OSSetThreadSpecific ( s32 index, void* ptr );</pre> 26 </dd> 27</dl> 28<h2>Arguments</h2> 29<TABLE border="1" cellpadding="3" cellspacing="0.1"> 30 <tr> 31<TD width="120" bgcolor="#ffffe8"><code><b><i><STRONG><EM><CODE>index</CODE></EM></STRONG></i></b></code></TD> 32<TD width="520">Index to the thread-specific data (zero or one).</TD> 33 </tr> 34 <tr> 35<TD width="120" bgcolor="#ffffe8"><code><b><i><code><EM><STRONG>ptr</STRONG></EM></code></i></b></code></TD> 36<TD width="520">Thread-specific data to set (<code>OSSetThreadSpecific</code>).</TD> 37 </tr> 38</TABLE> 39<h2>Return Values</h2> 40<P>The <code>OSGetThreadSpecific</code> function returns the thread-specific data at <code><em><strong>index</strong></em></code>. The <code>OSSetThreadSpecific</code> function does not have return values.</P> 41<h2>Description</h2> 42<P>Gets/sets data specific to the thread that calls this function. Up to a maximum of <code>OS_THREAD_SPECIFIC_MAX</code> <CODE>void</CODE> type pointers can be separately stored for each thread in the <code>OSThread</code> structure. When threads are created, thread-specific data is zeroed out.</P> 43 44<h2>See Also</h2> 45 46<p><a href="../toc.html#Thread" target="contents">Thread Functions</a>, <a href="../toc.html#ThreadSynchronization" target="contents">Thread Synchronization Functions</a>, <a href="OSCreateThread.html"><code>OSCreateThread</code></a>, <a href="OSGetThreadPriority.html"><code>OSGetThreadPriority</code></a></p> 47<H2>Revision History</H2> 48<P>03/01/2006 Initial version.</P> 49</body> 50</html>