Example #1
0
void
_glapi_set_current(const struct _glapi_table *dispatch)
{
    if (dispatch == NULL)
    {
        dispatch = (const struct _glapi_table *) table_noop_array;
    }
    u_current_set(dispatch);
}
Example #2
0
/**
 * We should call this periodically from a function such as glXMakeCurrent
 * in order to test if multiple threads are being used.
 */
void
u_current_init(void)
{
   static unsigned long knownID;
   static int firstCall = 1;

   if (ThreadSafe)
      return;

   u_mutex_lock(ThreadCheckMutex);
   if (firstCall) {
      u_current_init_tsd();

      knownID = u_thread_self();
      firstCall = 0;
   }
   else if (knownID != u_thread_self()) {
      ThreadSafe = 1;
      u_current_set(NULL);
      u_current_set_user(NULL);
   }
   u_mutex_unlock(ThreadCheckMutex);
}
Example #3
0
void
_glapi_set_dispatch(struct _glapi_table *dispatch)
{
   u_current_set((const struct mapi_table *) dispatch);
}