summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>1999-12-17 12:20:23 +0000
committerBrian Paul <[email protected]>1999-12-17 12:20:23 +0000
commit590d34726d96bbe238c4c1d1b09ab5e905c4ca73 (patch)
tree9b7cc8a11f84d7bb07afb8af854188f4d89f59a9
parente2b10e72a641d0450bd7c537af2929381371770f (diff)
more tweaking of thread support
-rw-r--r--src/mesa/glapi/glapi.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c
index 091932bf03b..47dd1dfe443 100644
--- a/src/mesa/glapi/glapi.c
+++ b/src/mesa/glapi/glapi.c
@@ -1,4 +1,4 @@
-/* $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
@@ -124,6 +124,10 @@ _glapi_set_dispatch(struct _glapi_table *dispatch)
#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
@@ -141,8 +145,10 @@ _glapi_get_dispatch(void)
if (ThreadSafe) {
return (struct _glapi_table *) _glthread_GetTSD(&DispatchTSD);
}
- else
+ else {
+ assert(Dispatch);
return Dispatch;
+ }
#else
return Dispatch;
#endif
@@ -449,7 +455,6 @@ _glapi_check_table(const struct _glapi_table *table)
const struct _glapi_table *dispatch; \
if (ThreadSafe) { \
dispatch = _glapi_get_dispatch(); \
- assert(dispatch); \
} \
else { \
dispatch = Dispatch; \