102f4aeb0Sopenharmony_ci<?xml version="1.0" encoding="UTF-8" standalone="no"?> 202f4aeb0Sopenharmony_ci<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"> 302f4aeb0Sopenharmony_ci <head> 402f4aeb0Sopenharmony_ci <title xmlns:xlink="http://www.w3.org/1999/xlink">eglReleaseThread - EGL Reference Pages</title> 502f4aeb0Sopenharmony_ci <link rel="stylesheet" type="text/css" href="khronos-man.css"/> 602f4aeb0Sopenharmony_ci <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"/> 702f4aeb0Sopenharmony_ci </head> 802f4aeb0Sopenharmony_ci <body> 902f4aeb0Sopenharmony_ci <header/> 1002f4aeb0Sopenharmony_ci <div class="refentry" id="eglReleaseThread"> 1102f4aeb0Sopenharmony_ci <div class="titlepage"/> 1202f4aeb0Sopenharmony_ci <div class="refnamediv"> 1302f4aeb0Sopenharmony_ci <h2>Name</h2> 1402f4aeb0Sopenharmony_ci <p>eglReleaseThread — Release EGL per-thread state</p> 1502f4aeb0Sopenharmony_ci </div> 1602f4aeb0Sopenharmony_ci <div class="refsynopsisdiv"> 1702f4aeb0Sopenharmony_ci <h2>C Specification</h2> 1802f4aeb0Sopenharmony_ci <div class="funcsynopsis"> 1902f4aeb0Sopenharmony_ci <table style="border: 0; cellspacing: 0; cellpadding: 0;" class="funcprototype-table"> 2002f4aeb0Sopenharmony_ci <tr> 2102f4aeb0Sopenharmony_ci <td> 2202f4aeb0Sopenharmony_ci <code class="funcdef">EGLBoolean <strong class="fsfunc">eglReleaseThread</strong>(</code> 2302f4aeb0Sopenharmony_ci </td> 2402f4aeb0Sopenharmony_ci <td><code>void)</code>;</td> 2502f4aeb0Sopenharmony_ci <td> </td> 2602f4aeb0Sopenharmony_ci </tr> 2702f4aeb0Sopenharmony_ci </table> 2802f4aeb0Sopenharmony_ci <div class="funcprototype-spacer"> </div> 2902f4aeb0Sopenharmony_ci </div> 3002f4aeb0Sopenharmony_ci </div> 3102f4aeb0Sopenharmony_ci <div class="refsect1" id="description"> 3202f4aeb0Sopenharmony_ci <h2>Description</h2> 3302f4aeb0Sopenharmony_ci <p> 3402f4aeb0Sopenharmony_ci <code class="function">eglReleaseThread</code> returns the EGL to its 3502f4aeb0Sopenharmony_ci state at thread initialization, releasing all per-thread 3602f4aeb0Sopenharmony_ci state including the error status returned by 3702f4aeb0Sopenharmony_ci <span class="command"><strong>eglGetError</strong></span>, the currently bound 3802f4aeb0Sopenharmony_ci rendering API defined by <span class="command"><strong>eglBindAPI</strong></span>, and 3902f4aeb0Sopenharmony_ci the current contexts for each supported client API. The 4002f4aeb0Sopenharmony_ci overhead of maintaining this state may be objectionable in 4102f4aeb0Sopenharmony_ci applications which create and destroy many threads, but only 4202f4aeb0Sopenharmony_ci call EGL or client APIs in a few of those threads at any 4302f4aeb0Sopenharmony_ci given time. 4402f4aeb0Sopenharmony_ci </p> 4502f4aeb0Sopenharmony_ci <p> 4602f4aeb0Sopenharmony_ci <code class="constant">EGL_TRUE</code> is returned on success, and the 4702f4aeb0Sopenharmony_ci following actions are taken: 4802f4aeb0Sopenharmony_ci </p> 4902f4aeb0Sopenharmony_ci <div class="itemizedlist"> 5002f4aeb0Sopenharmony_ci <ul class="itemizedlist" style="list-style-type: disc; "> 5102f4aeb0Sopenharmony_ci <li class="listitem"> 5202f4aeb0Sopenharmony_ci <p> 5302f4aeb0Sopenharmony_ci For each client API supported by EGL, if there is a 5402f4aeb0Sopenharmony_ci currently bound context, that context is released. 5502f4aeb0Sopenharmony_ci This is equivalent to calling 5602f4aeb0Sopenharmony_ci <code class="function">eglMakeCurrent</code> with ctx set to 5702f4aeb0Sopenharmony_ci <code class="constant">EGL_NO_CONTEXT</code> and both draw 5802f4aeb0Sopenharmony_ci and read set to <code class="constant">EGL_NO_SURFACE</code> 5902f4aeb0Sopenharmony_ci (see section 3.7.3). 6002f4aeb0Sopenharmony_ci </p> 6102f4aeb0Sopenharmony_ci </li> 6202f4aeb0Sopenharmony_ci <li class="listitem"> 6302f4aeb0Sopenharmony_ci <p> 6402f4aeb0Sopenharmony_ci The current rendering API is reset to its value at 6502f4aeb0Sopenharmony_ci thread initialization (see 6602f4aeb0Sopenharmony_ci <span class="command"><strong>eglBindAPI</strong></span>). 6702f4aeb0Sopenharmony_ci </p> 6802f4aeb0Sopenharmony_ci </li> 6902f4aeb0Sopenharmony_ci <li class="listitem"> 7002f4aeb0Sopenharmony_ci <p> 7102f4aeb0Sopenharmony_ci Any additional implementation-dependent per-thread 7202f4aeb0Sopenharmony_ci state maintained by EGL is marked for deletion as 7302f4aeb0Sopenharmony_ci soon as possible. 7402f4aeb0Sopenharmony_ci </p> 7502f4aeb0Sopenharmony_ci </li> 7602f4aeb0Sopenharmony_ci </ul> 7702f4aeb0Sopenharmony_ci </div> 7802f4aeb0Sopenharmony_ci <p> 7902f4aeb0Sopenharmony_ci <code class="function">eglReleaseThread</code> may be called in any 8002f4aeb0Sopenharmony_ci thread at any time, and may be called more than once in a 8102f4aeb0Sopenharmony_ci single thread. The initialization status of EGL (see section 8202f4aeb0Sopenharmony_ci 3.2) is not affected by releasing the thread; only 8302f4aeb0Sopenharmony_ci per-thread state is affected. 8402f4aeb0Sopenharmony_ci </p> 8502f4aeb0Sopenharmony_ci <p> 8602f4aeb0Sopenharmony_ci Resources explicitly allocated by calls to EGL, such as 8702f4aeb0Sopenharmony_ci contexts, surfaces, and configuration lists, are not 8802f4aeb0Sopenharmony_ci affected by <code class="function">eglReleaseThread</code>. Such 8902f4aeb0Sopenharmony_ci resources belong not to the thread, but to the EGL 9002f4aeb0Sopenharmony_ci implementation as a whole. 9102f4aeb0Sopenharmony_ci </p> 9202f4aeb0Sopenharmony_ci </div> 9302f4aeb0Sopenharmony_ci <div class="refsect1" id="notes"> 9402f4aeb0Sopenharmony_ci <h2>Notes</h2> 9502f4aeb0Sopenharmony_ci <p> 9602f4aeb0Sopenharmony_ci <code class="function">eglReleaseThread</code> is supported only if the 9702f4aeb0Sopenharmony_ci EGL version is 1.2 or greater. 9802f4aeb0Sopenharmony_ci </p> 9902f4aeb0Sopenharmony_ci <p> 10002f4aeb0Sopenharmony_ci Applications may call other EGL routines from a thread 10102f4aeb0Sopenharmony_ci following <code class="function">eglReleaseThread</code>, but any 10202f4aeb0Sopenharmony_ci such call may reallocate the EGL state previously released. 10302f4aeb0Sopenharmony_ci In particular, calling <code class="function">eglGetError</code> 10402f4aeb0Sopenharmony_ci immediately following a successful call to 10502f4aeb0Sopenharmony_ci <code class="function">eglReleaseThread</code> will return 10602f4aeb0Sopenharmony_ci <code class="constant">EGL_SUCCESS</code>, but will also result in 10702f4aeb0Sopenharmony_ci reallocating per-thread state. 10802f4aeb0Sopenharmony_ci </p> 10902f4aeb0Sopenharmony_ci </div> 11002f4aeb0Sopenharmony_ci <div class="refsect1" id="errors"> 11102f4aeb0Sopenharmony_ci <h2>Errors</h2> 11202f4aeb0Sopenharmony_ci <p> 11302f4aeb0Sopenharmony_ci <code class="constant">EGL_FALSE</code> is returned on failure, 11402f4aeb0Sopenharmony_ci <code class="constant">EGL_TRUE</code> otherwise. There are no 11502f4aeb0Sopenharmony_ci defined conditions under which failure will occur. Even if 11602f4aeb0Sopenharmony_ci EGL is not initialized on any EGLDisplay, 11702f4aeb0Sopenharmony_ci <code class="function">eglReleaseThread</code> should succeed. 11802f4aeb0Sopenharmony_ci </p> 11902f4aeb0Sopenharmony_ci <p> 12002f4aeb0Sopenharmony_ci However, platform-dependent failures may be signaled through 12102f4aeb0Sopenharmony_ci the value returned from <code class="function">eglGetError</code>. 12202f4aeb0Sopenharmony_ci Unless the platform-dependent behavior is known, a failed 12302f4aeb0Sopenharmony_ci call to <code class="function">eglReleaseThread</code> should be 12402f4aeb0Sopenharmony_ci assumed to leave the current rendering API, and the 12502f4aeb0Sopenharmony_ci currently bound contexts for each supported client API, in 12602f4aeb0Sopenharmony_ci an unknown state. 12702f4aeb0Sopenharmony_ci </p> 12802f4aeb0Sopenharmony_ci </div> 12902f4aeb0Sopenharmony_ci <div class="refsect1" id="seealso"> 13002f4aeb0Sopenharmony_ci <h2>See Also</h2> 13102f4aeb0Sopenharmony_ci <p> 13202f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglBindAPI.xhtml"><span class="citerefentry"><span class="refentrytitle">eglBindAPI</span></span></a>, 13302f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglGetError.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetError</span></span></a>, 13402f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglMakeCurrent.xhtml"><span class="citerefentry"><span class="refentrytitle">eglMakeCurrent</span></span></a> 13502f4aeb0Sopenharmony_ci </p> 13602f4aeb0Sopenharmony_ci </div> 13702f4aeb0Sopenharmony_ci <p> 13802f4aeb0Sopenharmony_ci </p> 13902f4aeb0Sopenharmony_ci <div class="refsect3" id="copyright"> 14002f4aeb0Sopenharmony_ci <img src="KhronosLogo.jpg"/> 14102f4aeb0Sopenharmony_ci <p> 14202f4aeb0Sopenharmony_ci Copyright © 2003-2014 The Khronos Group Inc. 14302f4aeb0Sopenharmony_ci Permission is hereby granted, free of charge, to any person obtaining a 14402f4aeb0Sopenharmony_ci copy of this software and/or associated documentation files (the 14502f4aeb0Sopenharmony_ci "Materials"), to deal in the Materials without restriction, including 14602f4aeb0Sopenharmony_ci without limitation the rights to use, copy, modify, merge, publish, 14702f4aeb0Sopenharmony_ci distribute, sublicense, and/or sell copies of the Materials, and to 14802f4aeb0Sopenharmony_ci permit persons to whom the Materials are furnished to do so, subject to 14902f4aeb0Sopenharmony_ci the condition that this copyright notice and permission notice shall be included 15002f4aeb0Sopenharmony_ci in all copies or substantial portions of the Materials. 15102f4aeb0Sopenharmony_ci </p> 15202f4aeb0Sopenharmony_ci </div> 15302f4aeb0Sopenharmony_ci <p> 15402f4aeb0Sopenharmony_ci</p> 15502f4aeb0Sopenharmony_ci </div> 15602f4aeb0Sopenharmony_ci <footer/> 15702f4aeb0Sopenharmony_ci </body> 15802f4aeb0Sopenharmony_ci</html> 159