2018 The Khronos Group Inc.
eglWaitSync 3G
eglWaitSync Wait in the server for a sync object to be signalled

## C Specification

EGLBoolean `eglWaitSync` (EGLDisplay display EGLSync sync EGLint flags

## Parameters

display

  Specifies the EGL display connection.

sync

  Specifies the sync object to wait on.

flags

  Specifies flags controlling wait behavior.

## Description

`eglWaitSync` is similar to `eglClientWaitSync`, but instead of blocking and not returning to the application until sync is signaled, `eglWaitSync` returns immediately. On success, `EGL_TRUE` is returned, and the server for the client API context will block until sync is signaled.

Note: `eglWaitSync` allows applications to continue to queue commands from the application in anticipation of the sync being signaled, potentially increasing parallelism between application, client API server code, and the GPU. The server only blocks execution of commands for the specific context on which `eglWaitSync` was issued; other contexts implemented by the same server are not affected..

sync has the same meaning as for `eglClientWaitSync`.

flags must be 0.

`eglWaitSync` requires support from the bound client API, and will not succeed unless the same client API properties described for creation of fence syncs in eglCreateSync are satisfied.

## Errors

`eglWaitSync` returns `EGL_FALSE` on failure, and does not cause the server for the client API context to block.

If the current context for the currently bound client API does not support server waits, an `EGL_BAD_MATCH` error is generated.

If no context is current for the currently bound client API (i.e., `eglGetCurrentContext` returns `EGL_NO_CONTEXT`), an `EGL_BAD_MATCH` error is generated.

If display does not match the EGLDisplay passed to `eglCreateSync` when sync was created, the behavior is undefined.

If sync is not a valid sync object for display, an `EGL_BAD_PARAMETER` error is generated.

If flags is not 0, an `EGL_BAD_PARAMETER` error is generated.

## Notes

`eglWaitSync` is available only if the EGL version is 1.5 or greater.

## See Also

eglClientWaitSync, eglCreateSync, eglGetCurrentContext