/** * Set the global or per-thread dispatch table pointer. * If the dispatch parameter is NULL we'll plug in the no-op dispatch * table (__glapi_noop_table). */ PUBLIC void _glapi_set_dispatch(struct _glapi_table *dispatch) { #if defined(PTHREADS) || defined(GLX_USE_TLS) static pthread_once_t once_control = PTHREAD_ONCE_INIT; pthread_once( & once_control, init_glapi_relocs ); #endif if (!dispatch) { /* use the no-op functions */ dispatch = (struct _glapi_table *) __glapi_noop_table; } #ifdef DEBUG else { _glapi_check_table(dispatch); } #endif #if defined(GLX_USE_TLS) _glapi_tls_Dispatch = dispatch; #elif defined(THREADS) _glthread_SetTSD(&_gl_DispatchTSD, (void *) dispatch); _glapi_Dispatch = (ThreadSafe) ? NULL : dispatch; #else /*THREADS*/ _glapi_Dispatch = dispatch; #endif /*THREADS*/ }
static void SetCurrentContext(GLXContext c) { #if defined(GLX_USE_TLS) CurrentContext = c; #elif defined(THREADS) _glthread_SetTSD(&ContextTSD, c); #else CurrentContext = c; #endif }
/** * Set the current context pointer for this thread. * The context pointer is an opaque type which should be cast to * void from the real context pointer type. */ PUBLIC void _glapi_set_context(void *context) { #if defined(GLX_USE_TLS) _glapi_tls_Context = context; #elif defined(THREADS) _glthread_SetTSD(&ContextTSD, context); _glapi_Context = context; #else _glapi_Context = context; #endif }
/** * Set the current context pointer for this thread. * The context pointer is an opaque type which should be cast to * void from the real context pointer type. */ PUBLIC void _glapi_set_context(void *context) { (void) __unused_noop_functions; /* silence a warning */ #if defined(GLX_USE_TLS) _glapi_tls_Context = context; #elif defined(THREADS) _glthread_SetTSD(&ContextTSD, context); _glapi_Context = (ThreadSafe) ? NULL : context; #else _glapi_Context = context; #endif }
/** * Set the global or per-thread dispatch table pointer. */ PUBLIC void _glapi_set_dispatch(struct _glapi_table *dispatch) { #if defined(PTHREADS) || defined(GLX_USE_TLS) static pthread_once_t once_control = PTHREAD_ONCE_INIT; pthread_once( & once_control, init_glapi_relocs ); #endif #if defined(GLX_USE_TLS) _glapi_tls_Dispatch = dispatch; #elif defined(THREADS) _glthread_SetTSD(&_gl_DispatchTSD, (void *) dispatch); _glapi_Dispatch = dispatch; #else /*THREADS*/ _glapi_Dispatch = dispatch; #endif /*THREADS*/ }