diff options
author | George Sapountzis <[email protected]> | 2010-03-01 04:44:02 +0200 |
---|---|---|
committer | George Sapountzis <[email protected]> | 2010-03-01 20:54:20 +0200 |
commit | d41ab94d35cb47effbd2582289298be4f13c50e4 (patch) | |
tree | 01210f712026af2a1daf5cf502df33b2b154f440 /src/mesa/glapi/glapi.c | |
parent | 7b454b00a4423937bd83ecff2d61ff08e6504707 (diff) |
glapi.c: misc coscmetic for FreeTSD
- move out of of the dispatch/context block to after corresponding init functions
- use more consistent naming with corresponding init functions
- XXX use _glthread_InitTSD() vs (void)_glthread_GetTSD() in _glapi_check_multithread() XXX
Diffstat (limited to 'src/mesa/glapi/glapi.c')
-rw-r--r-- | src/mesa/glapi/glapi.c | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index fe523073ca4..056abd72338 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -118,15 +118,6 @@ _glthread_TSD _gl_DispatchTSD; /**< Per-thread dispatch pointer */ static _glthread_TSD ContextTSD; /**< Per-thread context pointer */ -#if defined(WIN32_THREADS) -void FreeTSD(_glthread_TSD *p); -void FreeAllTSD(void) -{ - FreeTSD(&_gl_DispatchTSD); - FreeTSD(&ContextTSD); -} -#endif /* defined(WIN32_THREADS) */ - #endif /* defined(THREADS) */ PUBLIC struct _glapi_table *_glapi_Dispatch = (struct _glapi_table *) __glapi_noop_table; @@ -140,6 +131,22 @@ PUBLIC void *_glapi_Context = NULL; #if defined(THREADS) && !defined(GLX_USE_TLS) +void +_glapi_init_multithread(void) +{ + _glthread_InitTSD(&_gl_DispatchTSD); + _glthread_InitTSD(&ContextTSD); +} + +void +_glapi_destroy_multithread(void) +{ +#ifdef WIN32_THREADS + _glthread_DestroyTSD(&_gl_DispatchTSD); + _glthread_DestroyTSD(&ContextTSD); +#endif +} + /** * Mutex for multithread check. */ @@ -168,9 +175,7 @@ _glapi_check_multithread(void) CHECK_MULTITHREAD_LOCK(); if (firstCall) { - /* initialize TSDs */ - (void) _glthread_GetTSD(&ContextTSD); - (void) _glthread_GetTSD(&_gl_DispatchTSD); + _glapi_init_multithread(void) knownID = _glthread_GetID(); firstCall = GL_FALSE; @@ -185,6 +190,12 @@ _glapi_check_multithread(void) #else +void +_glapi_init_multithread(void) { } + +void +_glapi_destroy_multithread(void) { } + PUBLIC void _glapi_check_multithread(void) { } |