102f4aeb0Sopenharmony_ci<?xml version="1.0" encoding="UTF-8"?> 202f4aeb0Sopenharmony_ci<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN" 302f4aeb0Sopenharmony_ci "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd"> 402f4aeb0Sopenharmony_ci<refentry xml:base="" id="eglReleaseThread"> 502f4aeb0Sopenharmony_ci <refentryinfo> 602f4aeb0Sopenharmony_ci <copyright> 702f4aeb0Sopenharmony_ci <year>2003-2014</year> 802f4aeb0Sopenharmony_ci <holder>The Khronos Group Inc.</holder> 902f4aeb0Sopenharmony_ci </copyright> 1002f4aeb0Sopenharmony_ci </refentryinfo> 1102f4aeb0Sopenharmony_ci <refmeta> 1202f4aeb0Sopenharmony_ci <refentrytitle>eglReleaseThread</refentrytitle> 1302f4aeb0Sopenharmony_ci <manvolnum>3G</manvolnum> 1402f4aeb0Sopenharmony_ci </refmeta> 1502f4aeb0Sopenharmony_ci <refnamediv> 1602f4aeb0Sopenharmony_ci <refname>eglReleaseThread</refname> 1702f4aeb0Sopenharmony_ci <refpurpose>Release EGL per-thread state</refpurpose> 1802f4aeb0Sopenharmony_ci </refnamediv> 1902f4aeb0Sopenharmony_ci <refsynopsisdiv><title>C Specification</title> 2002f4aeb0Sopenharmony_ci <funcsynopsis> 2102f4aeb0Sopenharmony_ci <funcprototype> 2202f4aeb0Sopenharmony_ci <funcdef>EGLBoolean <function>eglReleaseThread</function></funcdef> 2302f4aeb0Sopenharmony_ci <void/> 2402f4aeb0Sopenharmony_ci </funcprototype> 2502f4aeb0Sopenharmony_ci </funcsynopsis> 2602f4aeb0Sopenharmony_ci </refsynopsisdiv> 2702f4aeb0Sopenharmony_ci <refsect1 id="description"><title>Description</title> 2802f4aeb0Sopenharmony_ci <para> 2902f4aeb0Sopenharmony_ci <function>eglReleaseThread</function> returns the EGL to its 3002f4aeb0Sopenharmony_ci state at thread initialization, releasing all per-thread 3102f4aeb0Sopenharmony_ci state including the error status returned by 3202f4aeb0Sopenharmony_ci <command>eglGetError</command>, the currently bound 3302f4aeb0Sopenharmony_ci rendering API defined by <command>eglBindAPI</command>, and 3402f4aeb0Sopenharmony_ci the current contexts for each supported client API. The 3502f4aeb0Sopenharmony_ci overhead of maintaining this state may be objectionable in 3602f4aeb0Sopenharmony_ci applications which create and destroy many threads, but only 3702f4aeb0Sopenharmony_ci call EGL or client APIs in a few of those threads at any 3802f4aeb0Sopenharmony_ci given time. 3902f4aeb0Sopenharmony_ci </para> 4002f4aeb0Sopenharmony_ci <para> 4102f4aeb0Sopenharmony_ci <constant>EGL_TRUE</constant> is returned on success, and the 4202f4aeb0Sopenharmony_ci following actions are taken: 4302f4aeb0Sopenharmony_ci </para> 4402f4aeb0Sopenharmony_ci <itemizedlist> 4502f4aeb0Sopenharmony_ci <listitem> 4602f4aeb0Sopenharmony_ci <para> 4702f4aeb0Sopenharmony_ci For each client API supported by EGL, if there is a 4802f4aeb0Sopenharmony_ci currently bound context, that context is released. 4902f4aeb0Sopenharmony_ci This is equivalent to calling 5002f4aeb0Sopenharmony_ci <function>eglMakeCurrent</function> with ctx set to 5102f4aeb0Sopenharmony_ci <constant>EGL_NO_CONTEXT</constant> and both draw 5202f4aeb0Sopenharmony_ci and read set to <constant>EGL_NO_SURFACE</constant> 5302f4aeb0Sopenharmony_ci (see section 3.7.3). 5402f4aeb0Sopenharmony_ci </para> 5502f4aeb0Sopenharmony_ci </listitem> 5602f4aeb0Sopenharmony_ci <listitem> 5702f4aeb0Sopenharmony_ci <para> 5802f4aeb0Sopenharmony_ci The current rendering API is reset to its value at 5902f4aeb0Sopenharmony_ci thread initialization (see 6002f4aeb0Sopenharmony_ci <command>eglBindAPI</command>). 6102f4aeb0Sopenharmony_ci </para> 6202f4aeb0Sopenharmony_ci </listitem> 6302f4aeb0Sopenharmony_ci <listitem> 6402f4aeb0Sopenharmony_ci <para> 6502f4aeb0Sopenharmony_ci Any additional implementation-dependent per-thread 6602f4aeb0Sopenharmony_ci state maintained by EGL is marked for deletion as 6702f4aeb0Sopenharmony_ci soon as possible. 6802f4aeb0Sopenharmony_ci </para> 6902f4aeb0Sopenharmony_ci </listitem> 7002f4aeb0Sopenharmony_ci </itemizedlist> 7102f4aeb0Sopenharmony_ci <para> 7202f4aeb0Sopenharmony_ci <function>eglReleaseThread</function> may be called in any 7302f4aeb0Sopenharmony_ci thread at any time, and may be called more than once in a 7402f4aeb0Sopenharmony_ci single thread. The initialization status of EGL (see section 7502f4aeb0Sopenharmony_ci 3.2) is not affected by releasing the thread; only 7602f4aeb0Sopenharmony_ci per-thread state is affected. 7702f4aeb0Sopenharmony_ci </para> 7802f4aeb0Sopenharmony_ci <para> 7902f4aeb0Sopenharmony_ci Resources explicitly allocated by calls to EGL, such as 8002f4aeb0Sopenharmony_ci contexts, surfaces, and configuration lists, are not 8102f4aeb0Sopenharmony_ci affected by <function>eglReleaseThread</function>. Such 8202f4aeb0Sopenharmony_ci resources belong not to the thread, but to the EGL 8302f4aeb0Sopenharmony_ci implementation as a whole. 8402f4aeb0Sopenharmony_ci </para> 8502f4aeb0Sopenharmony_ci </refsect1> 8602f4aeb0Sopenharmony_ci <refsect1 id="notes"><title>Notes</title> 8702f4aeb0Sopenharmony_ci <para> 8802f4aeb0Sopenharmony_ci <function>eglReleaseThread</function> is supported only if the 8902f4aeb0Sopenharmony_ci EGL version is 1.2 or greater. 9002f4aeb0Sopenharmony_ci </para> 9102f4aeb0Sopenharmony_ci <para> 9202f4aeb0Sopenharmony_ci Applications may call other EGL routines from a thread 9302f4aeb0Sopenharmony_ci following <function>eglReleaseThread</function>, but any 9402f4aeb0Sopenharmony_ci such call may reallocate the EGL state previously released. 9502f4aeb0Sopenharmony_ci In particular, calling <function>eglGetError</function> 9602f4aeb0Sopenharmony_ci immediately following a successful call to 9702f4aeb0Sopenharmony_ci <function>eglReleaseThread</function> will return 9802f4aeb0Sopenharmony_ci <constant>EGL_SUCCESS</constant>, but will also result in 9902f4aeb0Sopenharmony_ci reallocating per-thread state. 10002f4aeb0Sopenharmony_ci </para> 10102f4aeb0Sopenharmony_ci </refsect1> 10202f4aeb0Sopenharmony_ci <refsect1 id="errors"><title>Errors</title> 10302f4aeb0Sopenharmony_ci <para> 10402f4aeb0Sopenharmony_ci <constant>EGL_FALSE</constant> is returned on failure, 10502f4aeb0Sopenharmony_ci <constant>EGL_TRUE</constant> otherwise. There are no 10602f4aeb0Sopenharmony_ci defined conditions under which failure will occur. Even if 10702f4aeb0Sopenharmony_ci EGL is not initialized on any EGLDisplay, 10802f4aeb0Sopenharmony_ci <function>eglReleaseThread</function> should succeed. 10902f4aeb0Sopenharmony_ci </para> 11002f4aeb0Sopenharmony_ci <para> 11102f4aeb0Sopenharmony_ci However, platform-dependent failures may be signaled through 11202f4aeb0Sopenharmony_ci the value returned from <function>eglGetError</function>. 11302f4aeb0Sopenharmony_ci Unless the platform-dependent behavior is known, a failed 11402f4aeb0Sopenharmony_ci call to <function>eglReleaseThread</function> should be 11502f4aeb0Sopenharmony_ci assumed to leave the current rendering API, and the 11602f4aeb0Sopenharmony_ci currently bound contexts for each supported client API, in 11702f4aeb0Sopenharmony_ci an unknown state. 11802f4aeb0Sopenharmony_ci </para> 11902f4aeb0Sopenharmony_ci </refsect1> 12002f4aeb0Sopenharmony_ci <refsect1 id="seealso"><title>See Also</title> 12102f4aeb0Sopenharmony_ci <para> 12202f4aeb0Sopenharmony_ci <citerefentry><refentrytitle>eglBindAPI</refentrytitle></citerefentry>, 12302f4aeb0Sopenharmony_ci <citerefentry><refentrytitle>eglGetError</refentrytitle></citerefentry>, 12402f4aeb0Sopenharmony_ci <citerefentry><refentrytitle>eglMakeCurrent</refentrytitle></citerefentry> 12502f4aeb0Sopenharmony_ci </para> 12602f4aeb0Sopenharmony_ci </refsect1> 12702f4aeb0Sopenharmony_ci <refsect3 id="Copyright"><title></title> 12802f4aeb0Sopenharmony_ci <!-- Content included from copyright.inc.xsl --> 12902f4aeb0Sopenharmony_ci <imageobject> 13002f4aeb0Sopenharmony_ci <imagedata fileref="KhronosLogo.jpg" format="jpg" /> 13102f4aeb0Sopenharmony_ci </imageobject> 13202f4aeb0Sopenharmony_ci <para /> 13302f4aeb0Sopenharmony_ci </refsect3> 13402f4aeb0Sopenharmony_ci</refentry> 135