• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3              "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4<refentry xml:base="" id="eglReleaseThread">
5    <refentryinfo>
6         <copyright>
7             <year>2003-2014</year>
8             <holder>The Khronos Group Inc.</holder>
9         </copyright>
10    </refentryinfo>
11    <refmeta>
12        <refentrytitle>eglReleaseThread</refentrytitle>
13        <manvolnum>3G</manvolnum>
14    </refmeta>
15    <refnamediv>
16        <refname>eglReleaseThread</refname>
17        <refpurpose>Release EGL per-thread state</refpurpose>
18    </refnamediv>
19    <refsynopsisdiv><title>C Specification</title>
20        <funcsynopsis>
21            <funcprototype>
22                <funcdef>EGLBoolean <function>eglReleaseThread</function></funcdef>
23                <void/>
24            </funcprototype>
25        </funcsynopsis>
26    </refsynopsisdiv>
27    <refsect1 id="description"><title>Description</title>
28        <para>
29            <function>eglReleaseThread</function> returns the EGL to its
30            state at thread initialization, releasing all per-thread
31            state including the error status returned by
32            <command>eglGetError</command>, the currently bound
33            rendering API defined by <command>eglBindAPI</command>, and
34            the current contexts for each supported client API. The
35            overhead of maintaining this state may be objectionable in
36            applications which create and destroy many threads, but only
37            call EGL or client APIs in a few of those threads at any
38            given time.
39        </para>
40        <para>
41            <constant>EGL_TRUE</constant> is returned on success, and the
42            following actions are taken:
43        </para>
44        <itemizedlist>
45            <listitem>
46                <para>
47                    For each client API supported by EGL, if there is a
48                    currently bound context, that context is released.
49                    This is equivalent to calling
50                    <function>eglMakeCurrent</function> with ctx set to
51                    <constant>EGL_NO_CONTEXT</constant> and both draw
52                    and read set to <constant>EGL_NO_SURFACE</constant>
53                    (see section 3.7.3).
54                </para>
55            </listitem>
56            <listitem>
57                <para>
58                    The current rendering API is reset to its value at
59                    thread initialization (see
60                    <command>eglBindAPI</command>).
61                </para>
62            </listitem>
63            <listitem>
64                <para>
65                    Any additional implementation-dependent per-thread
66                    state maintained by EGL is marked for deletion as
67                    soon as possible.
68                </para>
69            </listitem>
70        </itemizedlist>
71        <para>
72            <function>eglReleaseThread</function> may be called in any
73            thread at any time, and may be called more than once in a
74            single thread. The initialization status of EGL (see section
75            3.2) is not affected by releasing the thread; only
76            per-thread state is affected.
77        </para>
78        <para>
79            Resources explicitly allocated by calls to EGL, such as
80            contexts, surfaces, and configuration lists, are not
81            affected by <function>eglReleaseThread</function>. Such
82            resources belong not to the thread, but to the EGL
83            implementation as a whole.
84        </para>
85    </refsect1>
86    <refsect1 id="notes"><title>Notes</title>
87        <para>
88            <function>eglReleaseThread</function> is supported only if the
89            EGL version is 1.2 or greater.
90        </para>
91        <para>
92            Applications may call other EGL routines from a thread
93            following <function>eglReleaseThread</function>, but any
94            such call may reallocate the EGL state previously released.
95            In particular, calling <function>eglGetError</function>
96            immediately following a successful call to
97            <function>eglReleaseThread</function> will return
98            <constant>EGL_SUCCESS</constant>, but will also result in
99            reallocating per-thread state.
100        </para>
101    </refsect1>
102    <refsect1 id="errors"><title>Errors</title>
103        <para>
104            <constant>EGL_FALSE</constant> is returned on failure,
105            <constant>EGL_TRUE</constant> otherwise. There are no
106            defined conditions under which failure will occur. Even if
107            EGL is not initialized on any EGLDisplay,
108            <function>eglReleaseThread</function> should succeed.
109        </para>
110        <para>
111            However, platform-dependent failures may be signaled through
112            the value returned from <function>eglGetError</function>.
113            Unless the platform-dependent behavior is known, a failed
114            call to <function>eglReleaseThread</function> should be
115            assumed to leave the current rendering API, and the
116            currently bound contexts for each supported client API, in
117            an unknown state.
118        </para>
119    </refsect1>
120    <refsect1 id="seealso"><title>See Also</title>
121        <para>
122            <citerefentry><refentrytitle>eglBindAPI</refentrytitle></citerefentry>,
123            <citerefentry><refentrytitle>eglGetError</refentrytitle></citerefentry>,
124            <citerefentry><refentrytitle>eglMakeCurrent</refentrytitle></citerefentry>
125        </para>
126    </refsect1>
127    <refsect3 id="Copyright"><title></title>
128        <!-- Content included from copyright.inc.xsl -->
129        <imageobject>
130                <imagedata fileref="KhronosLogo.jpg" format="jpg" />
131        </imageobject>
132        <para />
133    </refsect3>
134</refentry>
135