1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title xmlns:xlink="http://www.w3.org/1999/xlink">eglReleaseThread - EGL Reference Pages</title> 5 <link rel="stylesheet" type="text/css" href="khronos-man.css"/> 6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"/> 7 </head> 8 <body> 9 <header/> 10 <div class="refentry" id="eglReleaseThread"> 11 <div class="titlepage"/> 12 <div class="refnamediv"> 13 <h2>Name</h2> 14 <p>eglReleaseThread — Release EGL per-thread state</p> 15 </div> 16 <div class="refsynopsisdiv"> 17 <h2>C Specification</h2> 18 <div class="funcsynopsis"> 19 <table style="border: 0; cellspacing: 0; cellpadding: 0;" class="funcprototype-table"> 20 <tr> 21 <td> 22 <code class="funcdef">EGLBoolean <strong class="fsfunc">eglReleaseThread</strong>(</code> 23 </td> 24 <td><code>void)</code>;</td> 25 <td> </td> 26 </tr> 27 </table> 28 <div class="funcprototype-spacer"> </div> 29 </div> 30 </div> 31 <div class="refsect1" id="description"> 32 <h2>Description</h2> 33 <p> 34 <code class="function">eglReleaseThread</code> returns the EGL to its 35 state at thread initialization, releasing all per-thread 36 state including the error status returned by 37 <span class="command"><strong>eglGetError</strong></span>, the currently bound 38 rendering API defined by <span class="command"><strong>eglBindAPI</strong></span>, and 39 the current contexts for each supported client API. The 40 overhead of maintaining this state may be objectionable in 41 applications which create and destroy many threads, but only 42 call EGL or client APIs in a few of those threads at any 43 given time. 44 </p> 45 <p> 46 <code class="constant">EGL_TRUE</code> is returned on success, and the 47 following actions are taken: 48 </p> 49 <div class="itemizedlist"> 50 <ul class="itemizedlist" style="list-style-type: disc; "> 51 <li class="listitem"> 52 <p> 53 For each client API supported by EGL, if there is a 54 currently bound context, that context is released. 55 This is equivalent to calling 56 <code class="function">eglMakeCurrent</code> with ctx set to 57 <code class="constant">EGL_NO_CONTEXT</code> and both draw 58 and read set to <code class="constant">EGL_NO_SURFACE</code> 59 (see section 3.7.3). 60 </p> 61 </li> 62 <li class="listitem"> 63 <p> 64 The current rendering API is reset to its value at 65 thread initialization (see 66 <span class="command"><strong>eglBindAPI</strong></span>). 67 </p> 68 </li> 69 <li class="listitem"> 70 <p> 71 Any additional implementation-dependent per-thread 72 state maintained by EGL is marked for deletion as 73 soon as possible. 74 </p> 75 </li> 76 </ul> 77 </div> 78 <p> 79 <code class="function">eglReleaseThread</code> may be called in any 80 thread at any time, and may be called more than once in a 81 single thread. The initialization status of EGL (see section 82 3.2) is not affected by releasing the thread; only 83 per-thread state is affected. 84 </p> 85 <p> 86 Resources explicitly allocated by calls to EGL, such as 87 contexts, surfaces, and configuration lists, are not 88 affected by <code class="function">eglReleaseThread</code>. Such 89 resources belong not to the thread, but to the EGL 90 implementation as a whole. 91 </p> 92 </div> 93 <div class="refsect1" id="notes"> 94 <h2>Notes</h2> 95 <p> 96 <code class="function">eglReleaseThread</code> is supported only if the 97 EGL version is 1.2 or greater. 98 </p> 99 <p> 100 Applications may call other EGL routines from a thread 101 following <code class="function">eglReleaseThread</code>, but any 102 such call may reallocate the EGL state previously released. 103 In particular, calling <code class="function">eglGetError</code> 104 immediately following a successful call to 105 <code class="function">eglReleaseThread</code> will return 106 <code class="constant">EGL_SUCCESS</code>, but will also result in 107 reallocating per-thread state. 108 </p> 109 </div> 110 <div class="refsect1" id="errors"> 111 <h2>Errors</h2> 112 <p> 113 <code class="constant">EGL_FALSE</code> is returned on failure, 114 <code class="constant">EGL_TRUE</code> otherwise. There are no 115 defined conditions under which failure will occur. Even if 116 EGL is not initialized on any EGLDisplay, 117 <code class="function">eglReleaseThread</code> should succeed. 118 </p> 119 <p> 120 However, platform-dependent failures may be signaled through 121 the value returned from <code class="function">eglGetError</code>. 122 Unless the platform-dependent behavior is known, a failed 123 call to <code class="function">eglReleaseThread</code> should be 124 assumed to leave the current rendering API, and the 125 currently bound contexts for each supported client API, in 126 an unknown state. 127 </p> 128 </div> 129 <div class="refsect1" id="seealso"> 130 <h2>See Also</h2> 131 <p> 132 <a class="citerefentry" href="eglBindAPI.xhtml"><span class="citerefentry"><span class="refentrytitle">eglBindAPI</span></span></a>, 133 <a class="citerefentry" href="eglGetError.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetError</span></span></a>, 134 <a class="citerefentry" href="eglMakeCurrent.xhtml"><span class="citerefentry"><span class="refentrytitle">eglMakeCurrent</span></span></a> 135 </p> 136 </div> 137 <p> 138 </p> 139 <div class="refsect3" id="copyright"> 140 <img src="KhronosLogo.jpg"/> 141 <p> 142 Copyright © 2003-2014 The Khronos Group Inc. 143 Permission is hereby granted, free of charge, to any person obtaining a 144 copy of this software and/or associated documentation files (the 145 "Materials"), to deal in the Materials without restriction, including 146 without limitation the rights to use, copy, modify, merge, publish, 147 distribute, sublicense, and/or sell copies of the Materials, and to 148 permit persons to whom the Materials are furnished to do so, subject to 149 the condition that this copyright notice and permission notice shall be included 150 in all copies or substantial portions of the Materials. 151 </p> 152 </div> 153 <p> 154</p> 155 </div> 156 <footer/> 157 </body> 158</html> 159