blob: 6f6021583de5051f1982fd9969a9d92a16f70e31 [file] [log] [blame]
<refentry xmlns="" version="5.0" xml:base="" xml:id="eglReleaseThread">
<holder>The Khronos Group Inc.</holder>
<refpurpose>Release EGL per-thread state</refpurpose>
<refsynopsisdiv><title>C Specification</title>
<funcdef>EGLBoolean <function>eglReleaseThread</function></funcdef>
<refsect1 xml:id="description"><title>Description</title>
<function>eglReleaseThread</function> returns the EGL to its
state at thread initialization, releasing all per-thread
state including the error status returned by
<command>eglGetError</command>, the currently bound
rendering API defined by <command>eglBindAPI</command>, and
the current contexts for each supported client API. The
overhead of maintaining this state may be objectionable in
applications which create and destroy many threads, but only
call EGL or client APIs in a few of those threads at any
given time.
<constant>EGL_TRUE</constant> is returned on success, and the
following actions are taken:
For each client API supported by EGL, if there is a
currently bound context, that context is released.
This is equivalent to calling
<function>eglMakeCurrent</function> with ctx set to
<constant>EGL_NO_CONTEXT</constant> and both draw
and read set to <constant>EGL_NO_SURFACE</constant>
(see section 3.7.3).
The current rendering API is reset to its value at
thread initialization (see
Any additional implementation-dependent per-thread
state maintained by EGL is marked for deletion as
soon as possible.
<function>eglReleaseThread</function> may be called in any
thread at any time, and may be called more than once in a
single thread. The initialization status of EGL (see section
3.2) is not affected by releasing the thread; only
per-thread state is affected.
Resources explicitly allocated by calls to EGL, such as
contexts, surfaces, and configuration lists, are not
affected by <function>eglReleaseThread</function>. Such
resources belong not to the thread, but to the EGL
implementation as a whole.
<refsect1 xml:id="notes"><title>Notes</title>
<function>eglReleaseThread</function> is supported only if the
EGL version is 1.2 or greater.
Applications may call other EGL routines from a thread
following <function>eglReleaseThread</function>, but any
such call may reallocate the EGL state previously released.
In particular, calling <function>eglGetError</function>
immediately following a successful call to
<function>eglReleaseThread</function> will return
<constant>EGL_SUCCESS</constant>, but will also result in
reallocating per-thread state.
<refsect1 xml:id="errors"><title>Errors</title>
<constant>EGL_FALSE</constant> is returned on failure,
<constant>EGL_TRUE</constant> otherwise. There are no
defined conditions under which failure will occur. Even if
EGL is not initialized on any EGLDisplay,
<function>eglReleaseThread</function> should succeed.
However, platform-dependent failures may be signaled through
the value returned from <function>eglGetError</function>.
Unless the platform-dependent behavior is known, a failed
call to <function>eglReleaseThread</function> should be
assumed to leave the current rendering API, and the
currently bound contexts for each supported client API, in
an unknown state.
<refsect1 xml:id="seealso"><title>See Also</title>
<xi:include xmlns:xi="" href="copyright.xml"/>