Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > bf9e3bc1aec7873c087fb2ccd927873f > files > 134

sdl2-docs-2.0.10-1.mga7.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>My Project: SDL_thread.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">My Project
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">SDL_thread.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="SDL__stdinc_8h_source.html">SDL_stdinc.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="SDL__error_8h_source.html">SDL_error.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="SDL__atomic_8h_source.html">SDL_atomic.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="SDL__mutex_8h_source.html">SDL_mutex.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="begin__code_8h_source.html">begin_code.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="close__code_8h_source.html">close_code.h</a>&quot;</code><br />
</div>
<p><a href="SDL__thread_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a97cd1dc60cea74b74273affb1a974db5"><td class="memItemLeft" align="right" valign="top"><a id="a97cd1dc60cea74b74273affb1a974db5"></a>
typedef struct SDL_Thread&#160;</td><td class="memItemRight" valign="bottom"><b>SDL_Thread</b></td></tr>
<tr class="separator:a97cd1dc60cea74b74273affb1a974db5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4db699531ce9f18f5a8547aa988b88e"><td class="memItemLeft" align="right" valign="top"><a id="ac4db699531ce9f18f5a8547aa988b88e"></a>
typedef unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>SDL_threadID</b></td></tr>
<tr class="separator:ac4db699531ce9f18f5a8547aa988b88e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07ce005c35ad6ac377d6124db7296026"><td class="memItemLeft" align="right" valign="top"><a id="a07ce005c35ad6ac377d6124db7296026"></a>
typedef unsigned int&#160;</td><td class="memItemRight" valign="bottom"><b>SDL_TLSID</b></td></tr>
<tr class="separator:a07ce005c35ad6ac377d6124db7296026"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a35d10c50423c326b20abea6a486f53e0"><td class="memItemLeft" align="right" valign="top">typedef int(SDLCALL *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__thread_8h.html#a35d10c50423c326b20abea6a486f53e0">SDL_ThreadFunction</a>) (void *data)</td></tr>
<tr class="separator:a35d10c50423c326b20abea6a486f53e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:acce8dea56f6b307fadd2949b64e3ebda"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__thread_8h.html#acce8dea56f6b307fadd2949b64e3ebda">SDL_ThreadPriority</a> { <b>SDL_THREAD_PRIORITY_LOW</b>, 
<b>SDL_THREAD_PRIORITY_NORMAL</b>, 
<b>SDL_THREAD_PRIORITY_HIGH</b>, 
<b>SDL_THREAD_PRIORITY_TIME_CRITICAL</b>
 }</td></tr>
<tr class="separator:acce8dea56f6b307fadd2949b64e3ebda"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aca3013d4f50e918b17d2721b37e59082"><td class="memItemLeft" align="right" valign="top">DECLSPEC SDL_Thread *SDLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__thread_8h.html#aca3013d4f50e918b17d2721b37e59082">SDL_CreateThread</a> (<a class="el" href="SDL__thread_8h.html#a35d10c50423c326b20abea6a486f53e0">SDL_ThreadFunction</a> fn, const char *name, void *data)</td></tr>
<tr class="separator:aca3013d4f50e918b17d2721b37e59082"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4bee261cd43d1e25ba75a89fff9fe75d"><td class="memItemLeft" align="right" valign="top">DECLSPEC SDL_Thread *SDLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__thread_8h.html#a4bee261cd43d1e25ba75a89fff9fe75d">SDL_CreateThreadWithStackSize</a> (<a class="el" href="SDL__thread_8h.html#a35d10c50423c326b20abea6a486f53e0">SDL_ThreadFunction</a> fn, const char *name, const size_t stacksize, void *data)</td></tr>
<tr class="separator:a4bee261cd43d1e25ba75a89fff9fe75d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe2ffa508d85379b355673d557e74d9f"><td class="memItemLeft" align="right" valign="top">DECLSPEC const char *SDLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__thread_8h.html#abe2ffa508d85379b355673d557e74d9f">SDL_GetThreadName</a> (SDL_Thread *thread)</td></tr>
<tr class="separator:abe2ffa508d85379b355673d557e74d9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a341933eef1470789de20b05c1392b9ae"><td class="memItemLeft" align="right" valign="top">DECLSPEC SDL_threadID SDLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__thread_8h.html#a341933eef1470789de20b05c1392b9ae">SDL_ThreadID</a> (void)</td></tr>
<tr class="separator:a341933eef1470789de20b05c1392b9ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0bf5d93ed5cb25ea59307472c62c66db"><td class="memItemLeft" align="right" valign="top">DECLSPEC SDL_threadID SDLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__thread_8h.html#a0bf5d93ed5cb25ea59307472c62c66db">SDL_GetThreadID</a> (SDL_Thread *thread)</td></tr>
<tr class="separator:a0bf5d93ed5cb25ea59307472c62c66db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adf4da9c0e6a6833bef9741344b09699d"><td class="memItemLeft" align="right" valign="top">DECLSPEC int SDLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__thread_8h.html#adf4da9c0e6a6833bef9741344b09699d">SDL_SetThreadPriority</a> (<a class="el" href="SDL__thread_8h.html#acce8dea56f6b307fadd2949b64e3ebda">SDL_ThreadPriority</a> priority)</td></tr>
<tr class="separator:adf4da9c0e6a6833bef9741344b09699d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac96743626ed21d2cdb0868a23cca9705"><td class="memItemLeft" align="right" valign="top">DECLSPEC void SDLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__thread_8h.html#ac96743626ed21d2cdb0868a23cca9705">SDL_WaitThread</a> (SDL_Thread *thread, int *status)</td></tr>
<tr class="separator:ac96743626ed21d2cdb0868a23cca9705"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af90602c51ef5a62f26ed9931af484906"><td class="memItemLeft" align="right" valign="top">DECLSPEC void SDLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__thread_8h.html#af90602c51ef5a62f26ed9931af484906">SDL_DetachThread</a> (SDL_Thread *thread)</td></tr>
<tr class="separator:af90602c51ef5a62f26ed9931af484906"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac7ed1ec8dec5b902da25b60da2b728fa"><td class="memItemLeft" align="right" valign="top">DECLSPEC SDL_TLSID SDLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__thread_8h.html#ac7ed1ec8dec5b902da25b60da2b728fa">SDL_TLSCreate</a> (void)</td></tr>
<tr class="memdesc:ac7ed1ec8dec5b902da25b60da2b728fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create an identifier that is globally visible to all threads but refers to data that is thread-specific.  <a href="#ac7ed1ec8dec5b902da25b60da2b728fa">More...</a><br /></td></tr>
<tr class="separator:ac7ed1ec8dec5b902da25b60da2b728fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab519f8d89ea808f32fc139071e6207bb"><td class="memItemLeft" align="right" valign="top">DECLSPEC void *SDLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__thread_8h.html#ab519f8d89ea808f32fc139071e6207bb">SDL_TLSGet</a> (SDL_TLSID id)</td></tr>
<tr class="memdesc:ab519f8d89ea808f32fc139071e6207bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the value associated with a thread local storage ID for the current thread.  <a href="#ab519f8d89ea808f32fc139071e6207bb">More...</a><br /></td></tr>
<tr class="separator:ab519f8d89ea808f32fc139071e6207bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a807c8306201205c7c3ac0cb34ac7cd77"><td class="memItemLeft" align="right" valign="top">DECLSPEC int SDLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="SDL__thread_8h.html#a807c8306201205c7c3ac0cb34ac7cd77">SDL_TLSSet</a> (SDL_TLSID id, const void *value, void(SDLCALL *destructor)(void *))</td></tr>
<tr class="memdesc:a807c8306201205c7c3ac0cb34ac7cd77"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the value associated with a thread local storage ID for the current thread.  <a href="#a807c8306201205c7c3ac0cb34ac7cd77">More...</a><br /></td></tr>
<tr class="separator:a807c8306201205c7c3ac0cb34ac7cd77"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Header for the SDL thread management routines. </p>
</div><h2 class="groupheader">Typedef Documentation</h2>
<a id="a35d10c50423c326b20abea6a486f53e0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a35d10c50423c326b20abea6a486f53e0">&#9670;&nbsp;</a></span>SDL_ThreadFunction</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int(SDLCALL * SDL_ThreadFunction) (void *data)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The function passed to <a class="el" href="SDL__thread_8h.html#aca3013d4f50e918b17d2721b37e59082">SDL_CreateThread()</a>. It is passed a void* user context parameter and returns an int. </p>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="acce8dea56f6b307fadd2949b64e3ebda"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acce8dea56f6b307fadd2949b64e3ebda">&#9670;&nbsp;</a></span>SDL_ThreadPriority</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="SDL__thread_8h.html#acce8dea56f6b307fadd2949b64e3ebda">SDL_ThreadPriority</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The SDL thread priority.</p>
<dl class="section note"><dt>Note</dt><dd>On many systems you require special privileges to set high or time critical priority. </dd></dl>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="aca3013d4f50e918b17d2721b37e59082"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aca3013d4f50e918b17d2721b37e59082">&#9670;&nbsp;</a></span>SDL_CreateThread()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DECLSPEC SDL_Thread* SDLCALL SDL_CreateThread </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="SDL__thread_8h.html#a35d10c50423c326b20abea6a486f53e0">SDL_ThreadFunction</a>&#160;</td>
          <td class="paramname"><em>fn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a thread with a default stack size.</p>
<p>This is equivalent to calling: SDL_CreateThreadWithStackSize(fn, name, 0, data); </p>

</div>
</div>
<a id="a4bee261cd43d1e25ba75a89fff9fe75d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4bee261cd43d1e25ba75a89fff9fe75d">&#9670;&nbsp;</a></span>SDL_CreateThreadWithStackSize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DECLSPEC SDL_Thread* SDLCALL SDL_CreateThreadWithStackSize </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="SDL__thread_8h.html#a35d10c50423c326b20abea6a486f53e0">SDL_ThreadFunction</a>&#160;</td>
          <td class="paramname"><em>fn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>stacksize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a thread.</p>
<p>Thread naming is a little complicated: Most systems have very small limits for the string length (Haiku has 32 bytes, Linux currently has 16, Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll have to see what happens with your system's debugger. The name should be UTF-8 (but using the naming limits of C identifiers is a better bet). There are no requirements for thread naming conventions, so long as the string is null-terminated UTF-8, but these guidelines are helpful in choosing a name:</p>
<p><a href="http://stackoverflow.com/questions/149932/naming-conventions-for-threads">http://stackoverflow.com/questions/149932/naming-conventions-for-threads</a></p>
<p>If a system imposes requirements, SDL will try to munge the string for it (truncate, etc), but the original string contents will be available from <a class="el" href="SDL__thread_8h.html#abe2ffa508d85379b355673d557e74d9f">SDL_GetThreadName()</a>.</p>
<p>The size (in bytes) of the new stack can be specified. Zero means "use
  the system default" which might be wildly different between platforms (x86 Linux generally defaults to eight megabytes, an embedded device might be a few kilobytes instead).</p>
<p>In SDL 2.1, stacksize will be folded into the original SDL_CreateThread function. </p>

</div>
</div>
<a id="af90602c51ef5a62f26ed9931af484906"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af90602c51ef5a62f26ed9931af484906">&#9670;&nbsp;</a></span>SDL_DetachThread()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DECLSPEC void SDLCALL SDL_DetachThread </td>
          <td>(</td>
          <td class="paramtype">SDL_Thread *&#160;</td>
          <td class="paramname"><em>thread</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A thread may be "detached" to signify that it should not remain until another thread has called <a class="el" href="SDL__thread_8h.html#ac96743626ed21d2cdb0868a23cca9705">SDL_WaitThread()</a> on it. Detaching a thread is useful for long-running threads that nothing needs to synchronize with or further manage. When a detached thread is done, it simply goes away.</p>
<p>There is no way to recover the return code of a detached thread. If you need this, don't detach the thread and instead use <a class="el" href="SDL__thread_8h.html#ac96743626ed21d2cdb0868a23cca9705">SDL_WaitThread()</a>.</p>
<p>Once a thread is detached, you should usually assume the SDL_Thread isn't safe to reference again, as it will become invalid immediately upon the detached thread's exit, instead of remaining until someone has called <a class="el" href="SDL__thread_8h.html#ac96743626ed21d2cdb0868a23cca9705">SDL_WaitThread()</a> to finally clean it up. As such, don't detach the same thread more than once.</p>
<p>If a thread has already exited when passed to <a class="el" href="SDL__thread_8h.html#af90602c51ef5a62f26ed9931af484906">SDL_DetachThread()</a>, it will stop waiting for a call to <a class="el" href="SDL__thread_8h.html#ac96743626ed21d2cdb0868a23cca9705">SDL_WaitThread()</a> and clean up immediately. It is not safe to detach a thread that might be used with <a class="el" href="SDL__thread_8h.html#ac96743626ed21d2cdb0868a23cca9705">SDL_WaitThread()</a>.</p>
<p>You may not call <a class="el" href="SDL__thread_8h.html#ac96743626ed21d2cdb0868a23cca9705">SDL_WaitThread()</a> on a thread that has been detached. Use either that function or this one, but not both, or behavior is undefined.</p>
<p>It is safe to pass NULL to this function; it is a no-op. </p>

</div>
</div>
<a id="a0bf5d93ed5cb25ea59307472c62c66db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0bf5d93ed5cb25ea59307472c62c66db">&#9670;&nbsp;</a></span>SDL_GetThreadID()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID </td>
          <td>(</td>
          <td class="paramtype">SDL_Thread *&#160;</td>
          <td class="paramname"><em>thread</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the thread identifier for the specified thread.</p>
<p>Equivalent to <a class="el" href="SDL__thread_8h.html#a341933eef1470789de20b05c1392b9ae">SDL_ThreadID()</a> if the specified thread is NULL. </p>

</div>
</div>
<a id="abe2ffa508d85379b355673d557e74d9f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abe2ffa508d85379b355673d557e74d9f">&#9670;&nbsp;</a></span>SDL_GetThreadName()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DECLSPEC const char* SDLCALL SDL_GetThreadName </td>
          <td>(</td>
          <td class="paramtype">SDL_Thread *&#160;</td>
          <td class="paramname"><em>thread</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the thread name, as it was specified in <a class="el" href="SDL__thread_8h.html#aca3013d4f50e918b17d2721b37e59082">SDL_CreateThread()</a>. This function returns a pointer to a UTF-8 string that names the specified thread, or NULL if it doesn't have a name. This is internal memory, not to be free()'d by the caller, and remains valid until the specified thread is cleaned up by <a class="el" href="SDL__thread_8h.html#ac96743626ed21d2cdb0868a23cca9705">SDL_WaitThread()</a>. </p>

</div>
</div>
<a id="adf4da9c0e6a6833bef9741344b09699d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adf4da9c0e6a6833bef9741344b09699d">&#9670;&nbsp;</a></span>SDL_SetThreadPriority()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DECLSPEC int SDLCALL SDL_SetThreadPriority </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="SDL__thread_8h.html#acce8dea56f6b307fadd2949b64e3ebda">SDL_ThreadPriority</a>&#160;</td>
          <td class="paramname"><em>priority</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the priority for the current thread </p>

</div>
</div>
<a id="a341933eef1470789de20b05c1392b9ae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a341933eef1470789de20b05c1392b9ae">&#9670;&nbsp;</a></span>SDL_ThreadID()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DECLSPEC SDL_threadID SDLCALL SDL_ThreadID </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the thread identifier for the current thread. </p>

</div>
</div>
<a id="ac7ed1ec8dec5b902da25b60da2b728fa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac7ed1ec8dec5b902da25b60da2b728fa">&#9670;&nbsp;</a></span>SDL_TLSCreate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create an identifier that is globally visible to all threads but refers to data that is thread-specific. </p>
<dl class="section return"><dt>Returns</dt><dd>The newly created thread local storage identifier, or 0 on error</dd></dl>
<div class="fragment"><div class="line"><span class="keyword">static</span> SDL_SpinLock tls_lock;</div><div class="line"><span class="keyword">static</span> SDL_TLSID thread_local_storage;</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> SetMyThreadData(<span class="keywordtype">void</span> *value)</div><div class="line">{</div><div class="line">    <span class="keywordflow">if</span> (!thread_local_storage) {</div><div class="line">        <a class="code" href="SDL__atomic_8h.html#a95ecd72190ba8e5ed6ed78d5d1b36509">SDL_AtomicLock</a>(&amp;tls_lock);</div><div class="line">        <span class="keywordflow">if</span> (!thread_local_storage) {</div><div class="line">            thread_local_storage = <a class="code" href="SDL__thread_8h.html#ac7ed1ec8dec5b902da25b60da2b728fa">SDL_TLSCreate</a>();</div><div class="line">        }</div><div class="line">        <a class="code" href="SDL__atomic_8h.html#a3fb14c56b17347349ac2fb5300205bac">SDL_AtomicUnlock</a>(&amp;tls_lock);</div><div class="line">    }</div><div class="line">    <a class="code" href="SDL__thread_8h.html#a807c8306201205c7c3ac0cb34ac7cd77">SDL_TLSSet</a>(thread_local_storage, value, 0);</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> *GetMyThreadData(<span class="keywordtype">void</span>)</div><div class="line">{</div><div class="line">    <span class="keywordflow">return</span> <a class="code" href="SDL__thread_8h.html#ab519f8d89ea808f32fc139071e6207bb">SDL_TLSGet</a>(thread_local_storage);</div><div class="line">}</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><a class="el" href="SDL__thread_8h.html#ab519f8d89ea808f32fc139071e6207bb" title="Get the value associated with a thread local storage ID for the current thread.">SDL_TLSGet()</a> </dd>
<dd>
<a class="el" href="SDL__thread_8h.html#a807c8306201205c7c3ac0cb34ac7cd77" title="Set the value associated with a thread local storage ID for the current thread.">SDL_TLSSet()</a> </dd></dl>

</div>
</div>
<a id="ab519f8d89ea808f32fc139071e6207bb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab519f8d89ea808f32fc139071e6207bb">&#9670;&nbsp;</a></span>SDL_TLSGet()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DECLSPEC void* SDLCALL SDL_TLSGet </td>
          <td>(</td>
          <td class="paramtype">SDL_TLSID&#160;</td>
          <td class="paramname"><em>id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the value associated with a thread local storage ID for the current thread. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">id</td><td>The thread local storage ID</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The value associated with the ID for the current thread, or NULL if no value has been set.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="SDL__thread_8h.html#ac7ed1ec8dec5b902da25b60da2b728fa" title="Create an identifier that is globally visible to all threads but refers to data that is thread-specif...">SDL_TLSCreate()</a> </dd>
<dd>
<a class="el" href="SDL__thread_8h.html#a807c8306201205c7c3ac0cb34ac7cd77" title="Set the value associated with a thread local storage ID for the current thread.">SDL_TLSSet()</a> </dd></dl>

</div>
</div>
<a id="a807c8306201205c7c3ac0cb34ac7cd77"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a807c8306201205c7c3ac0cb34ac7cd77">&#9670;&nbsp;</a></span>SDL_TLSSet()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DECLSPEC int SDLCALL SDL_TLSSet </td>
          <td>(</td>
          <td class="paramtype">SDL_TLSID&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void(SDLCALL *destructor)(void *)&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the value associated with a thread local storage ID for the current thread. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">id</td><td>The thread local storage ID </td></tr>
    <tr><td class="paramname">value</td><td>The value to associate with the ID for the current thread </td></tr>
    <tr><td class="paramname">destructor</td><td>A function called when the thread exits, to free the value.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on error</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="SDL__thread_8h.html#ac7ed1ec8dec5b902da25b60da2b728fa" title="Create an identifier that is globally visible to all threads but refers to data that is thread-specif...">SDL_TLSCreate()</a> </dd>
<dd>
<a class="el" href="SDL__thread_8h.html#ab519f8d89ea808f32fc139071e6207bb" title="Get the value associated with a thread local storage ID for the current thread.">SDL_TLSGet()</a> </dd></dl>

</div>
</div>
<a id="ac96743626ed21d2cdb0868a23cca9705"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac96743626ed21d2cdb0868a23cca9705">&#9670;&nbsp;</a></span>SDL_WaitThread()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DECLSPEC void SDLCALL SDL_WaitThread </td>
          <td>(</td>
          <td class="paramtype">SDL_Thread *&#160;</td>
          <td class="paramname"><em>thread</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>status</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Wait for a thread to finish. Threads that haven't been detached will remain (as a "zombie") until this function cleans them up. Not doing so is a resource leak.</p>
<p>Once a thread has been cleaned up through this function, the SDL_Thread that references it becomes invalid and should not be referenced again. As such, only one thread may call <a class="el" href="SDL__thread_8h.html#ac96743626ed21d2cdb0868a23cca9705">SDL_WaitThread()</a> on another.</p>
<p>The return code for the thread function is placed in the area pointed to by <code>status</code>, if <code>status</code> is not NULL.</p>
<p>You may not wait on a thread that has been used in a call to <a class="el" href="SDL__thread_8h.html#af90602c51ef5a62f26ed9931af484906">SDL_DetachThread()</a>. Use either that function or this one, but not both, or behavior is undefined.</p>
<p>It is safe to pass NULL to this function; it is a no-op. </p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>