-/* $Id: glapi.c,v 1.16 1999/12/16 17:33:43 brianp Exp $ */
+/* $Id: glapi.c,v 1.17 1999/12/17 12:20:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
#if defined(THREADS)
_glthread_SetTSD(&DispatchTSD, (void*) dispatch, dispatch_thread_init);
+ if (ThreadSafe)
+ Dispatch = NULL; /* to help with debugging */
+ else
+ Dispatch = dispatch;
#else
Dispatch = dispatch;
#endif
if (ThreadSafe) {
return (struct _glapi_table *) _glthread_GetTSD(&DispatchTSD);
}
- else
+ else {
+ assert(Dispatch);
return Dispatch;
+ }
#else
return Dispatch;
#endif
const struct _glapi_table *dispatch; \
if (ThreadSafe) { \
dispatch = _glapi_get_dispatch(); \
- assert(dispatch); \
} \
else { \
dispatch = Dispatch; \