blob: a894b683d607b17cd70ee5c6d5678be27bca2b54 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html><html xmlns="">
<title xmlns:xlink="">eglReleaseThread - EGL Reference Pages</title>
<link rel="stylesheet" type="text/css" href="khronos-man.css"/>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"/>
<div class="refentry" id="eglReleaseThread">
<div class="titlepage"/>
<div class="refnamediv">
<p>eglReleaseThread — Release EGL per-thread state</p>
<div class="refsynopsisdiv">
<h2>C Specification</h2>
<div class="funcsynopsis">
<table style="border: 0; cellspacing: 0; cellpadding: 0;" class="funcprototype-table">
<code class="funcdef">EGLBoolean <strong class="fsfunc">eglReleaseThread</strong>(</code>
<td> </td>
<div class="funcprototype-spacer"> </div>
<div class="refsect1" id="description">
<code class="function">eglReleaseThread</code> returns the EGL to its
state at thread initialization, releasing all per-thread
state including the error status returned by
<span class="command"><strong>eglGetError</strong></span>, the currently bound
rendering API defined by <span class="command"><strong>eglBindAPI</strong></span>, 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.
<code class="constant">EGL_TRUE</code> is returned on success, and the
following actions are taken:
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
For each client API supported by EGL, if there is a
currently bound context, that context is released.
This is equivalent to calling
<code class="function">eglMakeCurrent</code> with ctx set to
<code class="constant">EGL_NO_CONTEXT</code> and both draw
and read set to <code class="constant">EGL_NO_SURFACE</code>
(see section 3.7.3).
<li class="listitem">
The current rendering API is reset to its value at
thread initialization (see
<span class="command"><strong>eglBindAPI</strong></span>).
<li class="listitem">
Any additional implementation-dependent per-thread
state maintained by EGL is marked for deletion as
soon as possible.
<code class="function">eglReleaseThread</code> 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 <code class="function">eglReleaseThread</code>. Such
resources belong not to the thread, but to the EGL
implementation as a whole.
<div class="refsect1" id="notes">
<code class="function">eglReleaseThread</code> is supported only if the
EGL version is 1.2 or greater.
Applications may call other EGL routines from a thread
following <code class="function">eglReleaseThread</code>, but any
such call may reallocate the EGL state previously released.
In particular, calling <code class="function">eglGetError</code>
immediately following a successful call to
<code class="function">eglReleaseThread</code> will return
<code class="constant">EGL_SUCCESS</code>, but will also result in
reallocating per-thread state.
<div class="refsect1" id="errors">
<code class="constant">EGL_FALSE</code> is returned on failure,
<code class="constant">EGL_TRUE</code> otherwise. There are no
defined conditions under which failure will occur. Even if
EGL is not initialized on any EGLDisplay,
<code class="function">eglReleaseThread</code> should succeed.
However, platform-dependent failures may be signaled through
the value returned from <code class="function">eglGetError</code>.
Unless the platform-dependent behavior is known, a failed
call to <code class="function">eglReleaseThread</code> should be
assumed to leave the current rendering API, and the
currently bound contexts for each supported client API, in
an unknown state.
<div class="refsect1" id="seealso">
<h2>See Also</h2>
<a class="citerefentry" href="eglBindAPI.xhtml"><span class="citerefentry"><span class="refentrytitle">eglBindAPI</span></span></a>,
<a class="citerefentry" href="eglGetError.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetError</span></span></a>,
<a class="citerefentry" href="eglMakeCurrent.xhtml"><span class="citerefentry"><span class="refentrytitle">eglMakeCurrent</span></span></a>
<div class="refsect3" id="copyright">
<img src="KhronosLogo.jpg"/>
Copyright © 2003-2014 The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.