1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title xmlns:xlink="http://www.w3.org/1999/xlink">eglClientWaitSync - EGL Reference Pages</title> 5 <link rel="stylesheet" type="text/css" href="khronos-man.css"/> 6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"/> 7 </head> 8 <body> 9 <header/> 10 <div class="refentry" id="eglClientWaitSync"> 11 <div class="titlepage"/> 12 <div class="refnamediv"> 13 <h2>Name</h2> 14 <p>eglClientWaitSync — 15 Wait in the client for a sync object to be signalled 16 </p> 17 </div> 18 <div class="refsynopsisdiv"> 19 <h2>C Specification</h2> 20 <div class="funcsynopsis"> 21 <table style="border: 0; cellspacing: 0; cellpadding: 0;" class="funcprototype-table"> 22 <tr> 23 <td> 24 <code class="funcdef">EGLint <strong class="fsfunc">eglClientWaitSync</strong>(</code> 25 </td> 26 <td>(EGLDisplay <var class="pdparam">display</var>, </td> 27 </tr> 28 <tr> 29 <td> </td> 30 <td>EGLSync <var class="pdparam">sync</var>, </td> 31 </tr> 32 <tr> 33 <td> </td> 34 <td>EGLint <var class="pdparam">flags</var>, </td> 35 </tr> 36 <tr> 37 <td> </td> 38 <td>EGLTime <var class="pdparam">timeout</var><code>)</code>;</td> 39 </tr> 40 </table> 41 <div class="funcprototype-spacer"> </div> 42 </div> 43 </div> 44 <div class="refsect1" id="parameters"> 45 <h2>Parameters</h2> 46 <div class="variablelist"> 47 <dl class="variablelist"> 48 <dt> 49 <span class="term"> 50 <em class="parameter"> 51 <code>display</code> 52 </em> 53 </span> 54 </dt> 55 <dd> 56 <p> 57 Specifies the <abbr class="acronym">EGL</abbr> display connection. 58 </p> 59 </dd> 60 <dt> 61 <span class="term"> 62 <em class="parameter"> 63 <code>sync</code> 64 </em> 65 </span> 66 </dt> 67 <dd> 68 <p> 69 Specifies the sync object to wait on. 70 </p> 71 </dd> 72 <dt> 73 <span class="term"> 74 <em class="parameter"> 75 <code>flags</code> 76 </em> 77 </span> 78 </dt> 79 <dd> 80 <p> 81 Specifies flags controlling wait behavior. 82 </p> 83 </dd> 84 <dt> 85 <span class="term"> 86 <em class="parameter"> 87 <code>timeout</code> 88 </em> 89 </span> 90 </dt> 91 <dd> 92 <p> 93 Specifies wait timeout interval. 94 </p> 95 </dd> 96 </dl> 97 </div> 98 </div> 99 <div class="refsect1" id="description"> 100 <h2>Description</h2> 101 <p> 102 <code class="function">eglClientWaitSync</code> blocks the calling thread 103 until the specified sync object <em class="parameter"><code>sync</code></em> is 104 signaled, or until <em class="parameter"><code>timeout</code></em> nanoseconds 105 have passed. 106 </p> 107 <p> 108 More than one <code class="function">eglClientWaitSync</code> may be 109 outstanding on the same <em class="parameter"><code>sync</code></em> at any given 110 time. When there are multiple threads blocked on the same 111 <em class="parameter"><code>sync</code></em> and the sync object is signaled, all 112 such threads are released, but the order in which they are 113 released is not defined. 114 </p> 115 <p> 116 If the value of <em class="parameter"><code>timeout</code></em> is zero, then 117 <code class="function">eglClientWaitSync</code> simply tests the current 118 status of <em class="parameter"><code>sync</code></em>. If the value of 119 <em class="parameter"><code>timeout</code></em> is the special value 120 <code class="constant">EGL_FOREVER</code>, then 121 <code class="function">eglClientWaitSync</code> does not time out. For 122 all other values, <em class="parameter"><code>timeout</code></em> is adjusted to 123 the closest value allowed by the implementation-dependent 124 timeout accuracy, which may be substantially longer than one 125 nanosecond. 126 </p> 127 <p> 128 <code class="function">eglClientWaitSync</code> returns one of three 129 status values describing the reason for returning. A return 130 value of <code class="constant">EGL_TIMEOUT_EXPIRED</code> indicates that 131 the specified timeout period expired before 132 <em class="parameter"><code>sync</code></em> was signaled, or if 133 <em class="parameter"><code>timeout</code></em> is zero, indicates that 134 <em class="parameter"><code>sync</code></em> is not signaled. A return value of 135 <code class="constant">EGL_CONDITION_SATISFIED</code> indicates that 136 <em class="parameter"><code>sync</code></em> was signaled before the timeout 137 expired, which includes the case when 138 <em class="parameter"><code>sync</code></em> was already signaled when 139 <code class="function">eglClientWaitSync</code> was called. If an error 140 occurs then an error is generated and 141 <code class="constant">EGL_FALSE</code> is returned. 142 </p> 143 <p> 144 If the sync object being blocked upon will not be signaled in 145 finite time (for example, by an associated fence command issued 146 previously, but not yet flushed to the graphics pipeline), then 147 <code class="function">eglClientWaitSync</code> may wait forever. To help 148 prevent this behavior, if the 149 <code class="constant">EGL_SYNC_FLUSH_COMMANDS_BIT</code> bit is set in 150 <em class="parameter"><code>flags</code></em>, and <em class="parameter"><code>sync</code></em> is 151 unsignaled when <code class="function">eglClientWaitSync</code> is 152 called, then the equivalent of Flush() will be performed for the 153 current API context (i.e., the context returned by 154 <code class="function">eglGetCurrentContext</code>) before blocking on 155 <em class="parameter"><code>sync</code></em>. If no context is current for the 156 bound API, the <code class="constant">EGL_SYNC_FLUSH_COMMANDS_BIT</code> 157 bit is ignored. 158 </p> 159 <p> 160 Note: the simple Flush behavior defined by 161 <code class="constant">EGL_SYNC_FLUSH_COMMANDS_BIT</code> will not help 162 when waiting for a fence command issued in a different context's 163 command stream. Applications which block on a fence sync object 164 must take additional steps to ensure that the context from which 165 the associated fence command was issued has flushed that command 166 to the graphics pipeline. 167 </p> 168 </div> 169 <div class="refsect1" id="errors"> 170 <h2>Errors</h2> 171 <p> 172 <code class="function">eglClientWaitSync</code> returns 173 <code class="constant">EGL_FALSE</code> on failure. 174 </p> 175 <p> 176 If <em class="parameter"><code>sync</code></em> is not a valid sync object for 177 <em class="parameter"><code>display</code></em>, an 178 <code class="constant">EGL_BAD_PARAMETER</code> error is generated. 179 </p> 180 <p> 181 If <em class="parameter"><code>display</code></em> does not match the 182 <span class="type">EGLDisplay</span> passed to 183 <code class="function">eglCreateSync</code> when 184 <em class="parameter"><code>sync</code></em> was created, the behaviour is 185 undefined. 186 </p> 187 </div> 188 <div class="refsect1" id="notes"> 189 <h2>Notes</h2> 190 <p> 191 <code class="function">eglClientWaitSync</code> is available only if the 192 EGL version is 1.5 or greater. 193 </p> 194 </div> 195 <div class="refsect1" id="seealso"> 196 <h2>See Also</h2> 197 <p> 198 <a class="citerefentry" href="eglCreateSync.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreateSync</span></span></a>, 199 <a class="citerefentry" href="eglGetCurrentContext.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetCurrentContext</span></span></a>, 200 <a class="citerefentry" href="eglWaitSync.xhtml"><span class="citerefentry"><span class="refentrytitle">eglWaitSync</span></span></a>, 201 <code class="function">glFinish</code>, 202 <code class="function">vgFinish</code> 203 </p> 204 </div> 205 <p> 206 </p> 207 <div class="refsect3" id="copyright"> 208 <img src="KhronosLogo.jpg"/> 209 <p> 210 Copyright © 2003-2014 The Khronos Group Inc. 211 Permission is hereby granted, free of charge, to any person obtaining a 212 copy of this software and/or associated documentation files (the 213 "Materials"), to deal in the Materials without restriction, including 214 without limitation the rights to use, copy, modify, merge, publish, 215 distribute, sublicense, and/or sell copies of the Materials, and to 216 permit persons to whom the Materials are furnished to do so, subject to 217 the condition that this copyright notice and permission notice shall be included 218 in all copies or substantial portions of the Materials. 219 </p> 220 </div> 221 <p> 222</p> 223 </div> 224 <footer/> 225 </body> 226</html> 227