GLXINITTHREADSSUN(3gl)GLXINITTHREADSSUN(3gl)NAME
glXInitThreadsSUN - multi-threading support
C SPECIFICATION
int glXInitThreadsSUN( void )
DESCRIPTION
The glXInitThreadsSUN function initializes GL support for concurrent
rendering threads. This function must first be called before glXCre‐
ateContext in a multi-threaded GL program, and it must complete before
any other GL call is made. This function returns a nonzero status if
initialization was successful; otherwise, it returns zero. On systems
that do not support threads, this function always returns zero.
It is only necessary to call this function if multiple rendering
threads might use GL concurrently. If all calls to GL functions are
protected by some other access mechanism (for example, a mutual exclu‐
sion lock in a toolkit or through explicit client programming), GL
thread initialization is not required. It is recommended that single-
threaded rendering programs not call this function.
This function is only client side so the extension string can be
retrieved using glXGetClientString. Typical usage:
#ifdef GLX_SUN_init_threads
if ( strstr ( glXGetClientString (dpy, GLX_EXTENSIONS ),
"GLX_SUN_init_threads" ) ) {
if ( ! glXInitThreadsSUN ( ) ) {
printf ("Unable to init GL ");
printf ("for multithreaded rendering\n");
}
}
#endif
NOTES
XInitThreads must be called before glXInitThreadsSUN.
glXQueryExtensionsString does not show a string for this function since
this function is client side only.
glXInitThreadsSUN is part of the GLX_SUN_init_threads extension, not
part of the core GL command set. If GLX_SUN_init_threads is included
in the string returned by glXGetClientString, when called with argument
GLX_EXTENSIONS, extension glXInitThreadsSUN is supported by the connec‐
tion.
SEE ALSO
glXGetClientString, glXQueryExtensionsString, glXMakeCurrent, XInit‐
Threads, XtToolkitThreadInitialize
9 Oct 00 GLXINITTHREADSSUN(3gl)