mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 20:00:10 +01:00
removed _glapi_ThreadSafe
This commit is contained in:
parent
90d9e02f3a
commit
26e14d2ea1
3 changed files with 20 additions and 23 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: glapi.c,v 1.18 1999/12/17 14:51:28 brianp Exp $ */
|
/* $Id: glapi.c,v 1.19 2000/01/05 04:36:17 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
|
|
||||||
|
|
||||||
/* Flag to indicate whether thread-safe dispatch is enabled */
|
/* Flag to indicate whether thread-safe dispatch is enabled */
|
||||||
GLboolean _glapi_ThreadSafe = GL_FALSE;
|
static GLboolean ThreadSafe = GL_FALSE;
|
||||||
|
|
||||||
/* This is used when thread safety is disabled */
|
/* This is used when thread safety is disabled */
|
||||||
static struct _glapi_table *Dispatch = &__glapi_noop_table;
|
static struct _glapi_table *Dispatch = &__glapi_noop_table;
|
||||||
|
|
@ -95,7 +95,7 @@ void
|
||||||
_glapi_check_multithread(void)
|
_glapi_check_multithread(void)
|
||||||
{
|
{
|
||||||
#if defined(THREADS)
|
#if defined(THREADS)
|
||||||
if (!_glapi_ThreadSafe) {
|
if (!ThreadSafe) {
|
||||||
static unsigned long knownID;
|
static unsigned long knownID;
|
||||||
static GLboolean firstCall = GL_TRUE;
|
static GLboolean firstCall = GL_TRUE;
|
||||||
if (firstCall) {
|
if (firstCall) {
|
||||||
|
|
@ -103,10 +103,10 @@ _glapi_check_multithread(void)
|
||||||
firstCall = GL_FALSE;
|
firstCall = GL_FALSE;
|
||||||
}
|
}
|
||||||
else if (knownID != _glthread_GetID()) {
|
else if (knownID != _glthread_GetID()) {
|
||||||
_glapi_ThreadSafe = GL_TRUE;
|
ThreadSafe = GL_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_glapi_ThreadSafe) {
|
if (ThreadSafe) {
|
||||||
/* make sure that this thread's dispatch pointer isn't null */
|
/* make sure that this thread's dispatch pointer isn't null */
|
||||||
if (!_glapi_get_dispatch()) {
|
if (!_glapi_get_dispatch()) {
|
||||||
_glapi_set_dispatch(NULL);
|
_glapi_set_dispatch(NULL);
|
||||||
|
|
@ -127,7 +127,7 @@ _glapi_set_current_context(void *context)
|
||||||
{
|
{
|
||||||
#if defined(THREADS)
|
#if defined(THREADS)
|
||||||
_glthread_SetTSD(&ContextTSD, context, context_thread_init);
|
_glthread_SetTSD(&ContextTSD, context, context_thread_init);
|
||||||
if (_glapi_ThreadSafe)
|
if (ThreadSafe)
|
||||||
_glapi_CurrentContext = NULL; /* to help with debugging */
|
_glapi_CurrentContext = NULL; /* to help with debugging */
|
||||||
else
|
else
|
||||||
_glapi_CurrentContext = context;
|
_glapi_CurrentContext = context;
|
||||||
|
|
@ -147,7 +147,7 @@ void *
|
||||||
_glapi_get_current_context(void)
|
_glapi_get_current_context(void)
|
||||||
{
|
{
|
||||||
#if defined(THREADS)
|
#if defined(THREADS)
|
||||||
if (_glapi_ThreadSafe) {
|
if (ThreadSafe) {
|
||||||
return _glthread_GetTSD(&ContextTSD);
|
return _glthread_GetTSD(&ContextTSD);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -178,7 +178,7 @@ _glapi_set_dispatch(struct _glapi_table *dispatch)
|
||||||
|
|
||||||
#if defined(THREADS)
|
#if defined(THREADS)
|
||||||
_glthread_SetTSD(&DispatchTSD, (void*) dispatch, dispatch_thread_init);
|
_glthread_SetTSD(&DispatchTSD, (void*) dispatch, dispatch_thread_init);
|
||||||
if (_glapi_ThreadSafe)
|
if (ThreadSafe)
|
||||||
Dispatch = NULL; /* to help with debugging */
|
Dispatch = NULL; /* to help with debugging */
|
||||||
else
|
else
|
||||||
Dispatch = dispatch;
|
Dispatch = dispatch;
|
||||||
|
|
@ -196,7 +196,7 @@ struct _glapi_table *
|
||||||
_glapi_get_dispatch(void)
|
_glapi_get_dispatch(void)
|
||||||
{
|
{
|
||||||
#if defined(THREADS)
|
#if defined(THREADS)
|
||||||
if (_glapi_ThreadSafe) {
|
if (ThreadSafe) {
|
||||||
return (struct _glapi_table *) _glthread_GetTSD(&DispatchTSD);
|
return (struct _glapi_table *) _glthread_GetTSD(&DispatchTSD);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -505,14 +505,9 @@ _glapi_check_table(const struct _glapi_table *table)
|
||||||
#define NAME(func) gl##func
|
#define NAME(func) gl##func
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DISPATCH_SETUP \
|
#define DISPATCH_SETUP \
|
||||||
const struct _glapi_table *dispatch; \
|
const struct _glapi_table *dispatch; \
|
||||||
if (_glapi_ThreadSafe) { \
|
dispatch = Dispatch ? Dispatch : _glapi_get_dispatch();
|
||||||
dispatch = _glapi_get_dispatch(); \
|
|
||||||
} \
|
|
||||||
else { \
|
|
||||||
dispatch = Dispatch; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define DISPATCH(FUNC, ARGS) (dispatch->FUNC) ARGS
|
#define DISPATCH(FUNC, ARGS) (dispatch->FUNC) ARGS
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: glapi.h,v 1.11 1999/12/17 14:51:29 brianp Exp $ */
|
/* $Id: glapi.h,v 1.12 2000/01/05 04:36:17 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
|
|
@ -34,8 +34,6 @@
|
||||||
struct _glapi_table;
|
struct _glapi_table;
|
||||||
|
|
||||||
|
|
||||||
extern GLboolean _glapi_ThreadSafe;
|
|
||||||
|
|
||||||
extern void *_glapi_CurrentContext;
|
extern void *_glapi_CurrentContext;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: context.h,v 1.8 1999/12/17 17:01:31 brianp Exp $ */
|
/* $Id: context.h,v 1.9 2000/01/05 04:36:17 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
|
|
@ -123,9 +123,10 @@ extern GLcontext *gl_get_current_context(void);
|
||||||
*/
|
*/
|
||||||
#ifdef THREADS
|
#ifdef THREADS
|
||||||
|
|
||||||
#define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) (_glapi_ThreadSafe ? _glapi_get_current_context() : _glapi_CurrentContext)
|
#define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) (_glapi_CurrentContext ? _glapi_CurrentContext : _glapi_get_current_context())
|
||||||
|
|
||||||
|
#define GET_IMMEDIATE struct immediate *IM = ((GLcontext *) (_glapi_CurrentContext ? _glapi_CurrentContext : _glapi_get_current_context()))->input
|
||||||
|
|
||||||
#define GET_IMMEDIATE struct immediate *IM = ((GLcontext *) (_glapi_ThreadSafe ? _glapi_get_current_context() : _glapi_CurrentContext))->input;
|
|
||||||
#define SET_IMMEDIATE(ctx, im) \
|
#define SET_IMMEDIATE(ctx, im) \
|
||||||
do { \
|
do { \
|
||||||
ctx->input = im; \
|
ctx->input = im; \
|
||||||
|
|
@ -134,8 +135,11 @@ do { \
|
||||||
#else
|
#else
|
||||||
|
|
||||||
extern struct immediate *CURRENT_INPUT;
|
extern struct immediate *CURRENT_INPUT;
|
||||||
|
|
||||||
#define GET_CURRENT_CONTEXT(C) GLcontext *C = _glapi_CurrentContext
|
#define GET_CURRENT_CONTEXT(C) GLcontext *C = _glapi_CurrentContext
|
||||||
|
|
||||||
#define GET_IMMEDIATE struct immediate *IM = CURRENT_INPUT
|
#define GET_IMMEDIATE struct immediate *IM = CURRENT_INPUT
|
||||||
|
|
||||||
#define SET_IMMEDIATE(ctx, im) \
|
#define SET_IMMEDIATE(ctx, im) \
|
||||||
do { \
|
do { \
|
||||||
ctx->input = im; \
|
ctx->input = im; \
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue