• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:base="" xml:id="eglClientWaitSync">
2    <info>
3         <copyright>
4             <year>2018</year>
5             <holder>The Khronos Group Inc.</holder>
6         </copyright>
7    </info>
8    <refmeta>
9        <refentrytitle>eglClientWaitSync</refentrytitle>
10        <manvolnum>3G</manvolnum>
11    </refmeta>
12    <refnamediv>
13        <refname>eglClientWaitSync</refname>
14        <refpurpose>
15            Wait in the client for a sync object to be signalled
16        </refpurpose>
17    </refnamediv>
18    <refsynopsisdiv>
19        <title>C Specification</title>
20        <funcsynopsis>
21            <funcprototype>
22            <funcdef>EGLint <function>eglClientWaitSync</function></funcdef>
23            <paramdef>(EGLDisplay <parameter>display</parameter></paramdef>
24            <paramdef>EGLSync <parameter>sync</parameter></paramdef>
25            <paramdef>EGLint <parameter>flags</parameter></paramdef>
26            <paramdef>EGLTime <parameter>timeout</parameter></paramdef>
27            </funcprototype>
28        </funcsynopsis>
29    </refsynopsisdiv>
30    <refsect1 xml:id="parameters"><title>Parameters</title>
31        <variablelist>
32            <varlistentry>
33                <term><parameter>display</parameter></term>
34                <listitem><para>
35                    Specifies the <acronym>EGL</acronym> display connection.
36                </para></listitem>
37            </varlistentry>
38            <varlistentry>
39                <term><parameter>sync</parameter></term>
40                <listitem><para>
41                    Specifies the sync object to wait on.
42                </para></listitem>
43            </varlistentry>
44            <varlistentry>
45                <term><parameter>flags</parameter></term>
46                <listitem><para>
47                    Specifies flags controlling wait behavior.
48                </para></listitem>
49            </varlistentry>
50            <varlistentry>
51                <term><parameter>timeout</parameter></term>
52                <listitem><para>
53                    Specifies wait timeout interval.
54                </para></listitem>
55            </varlistentry>
56        </variablelist>
57    </refsect1>
58    <refsect1 xml:id="description"><title>Description</title>
59        <para>
60            <function>eglClientWaitSync</function> blocks the calling thread
61            until the specified sync object <parameter>sync</parameter> is
62            signaled, or until <parameter>timeout</parameter> nanoseconds
63            have passed.
64        </para>
65        <para>
66            More than one <function>eglClientWaitSync</function> may be
67            outstanding on the same <parameter>sync</parameter> at any given
68            time. When there are multiple threads blocked on the same
69            <parameter>sync</parameter> and the sync object is signaled, all
70            such threads are released, but the order in which they are
71            released is not defined.
72        </para>
73        <para>
74            If the value of <parameter>timeout</parameter> is zero, then
75            <function>eglClientWaitSync</function> simply tests the current
76            status of <parameter>sync</parameter>. If the value of
77            <parameter>timeout</parameter> is the special value
78            <constant>EGL_FOREVER</constant>, then
79            <function>eglClientWaitSync</function> does not time out. For
80            all other values, <parameter>timeout</parameter> is adjusted to
81            the closest value allowed by the implementation-dependent
82            timeout accuracy, which may be substantially longer than one
83            nanosecond.
84        </para>
85        <para>
86            <function>eglClientWaitSync</function> returns one of three
87            status values describing the reason for returning. A return
88            value of <constant>EGL_TIMEOUT_EXPIRED</constant> indicates that
89            the specified timeout period expired before
90            <parameter>sync</parameter> was signaled, or if
91            <parameter>timeout</parameter> is zero, indicates that
92            <parameter>sync</parameter> is not signaled. A return value of
93            <constant>EGL_CONDITION_SATISFIED</constant> indicates that
94            <parameter>sync</parameter> was signaled before the timeout
95            expired, which includes the case when
96            <parameter>sync</parameter> was already signaled when
97            <function>eglClientWaitSync</function> was called. If an error
98            occurs then an error is generated and
99            <constant>EGL_FALSE</constant> is returned.
100        </para>
101        <para>
102            If the sync object being blocked upon will not be signaled in
103            finite time (for example, by an associated fence command issued
104            previously, but not yet flushed to the graphics pipeline), then
105            <function>eglClientWaitSync</function> may wait forever. To help
106            prevent this behavior, if the
107            <constant>EGL_SYNC_FLUSH_COMMANDS_BIT</constant> bit is set in
108            <parameter>flags</parameter>, and <parameter>sync</parameter> is
109            unsignaled when <function>eglClientWaitSync</function> is
110            called, then the equivalent of Flush() will be performed for the
111            current API context (i.e., the context returned by
112            <function>eglGetCurrentContext</function>) before blocking on
113            <parameter>sync</parameter>. If no context is current for the
114            bound API, the <constant>EGL_SYNC_FLUSH_COMMANDS_BIT</constant>
115            bit is ignored.
116        </para>
117        <para>
118            Note: the simple Flush behavior defined by
119            <constant>EGL_SYNC_FLUSH_COMMANDS_BIT</constant> will not help
120            when waiting for a fence command issued in a different context's
121            command stream. Applications which block on a fence sync object
122            must take additional steps to ensure that the context from which
123            the associated fence command was issued has flushed that command
124            to the graphics pipeline.
125        </para>
126    </refsect1>
127    <refsect1 xml:id="errors"><title>Errors</title>
128        <para>
129            <function>eglClientWaitSync</function> returns
130            <constant>EGL_FALSE</constant> on failure.
131        </para>
132        <para>
133            If <parameter>sync</parameter> is not a valid sync object for
134            <parameter>display</parameter>, an
135            <constant>EGL_BAD_PARAMETER</constant> error is generated.
136        </para>
137        <para>
138            If <parameter>display</parameter> does not match the
139            <type>EGLDisplay</type> passed to
140            <function>eglCreateSync</function> when
141            <parameter>sync</parameter> was created, the behaviour is
142            undefined.
143        </para>
144    </refsect1>
145    <refsect1 xml:id="notes"><title>Notes</title>
146        <para>
147            <function>eglClientWaitSync</function> is available only if the
148            EGL version is 1.5 or greater.
149        </para>
150    </refsect1>
151    <refsect1 xml:id="seealso"><title>See Also</title>
152        <para>
153            <citerefentry><refentrytitle>eglCreateSync</refentrytitle></citerefentry>,
154            <citerefentry><refentrytitle>eglGetCurrentContext</refentrytitle></citerefentry>,
155            <citerefentry><refentrytitle>eglWaitSync</refentrytitle></citerefentry>,
156            <function>glFinish</function>,
157            <function>vgFinish</function>
158        </para>
159    </refsect1>
160    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="copyright.xml"/>
161</refentry>
162