Changeset 39602 in vbox for trunk/src/VBox/Additions/common/crOpenGL
- Timestamp:
- Dec 14, 2011 11:12:17 AM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 75376
- Location:
- trunk/src/VBox/Additions/common/crOpenGL
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/context.c
r39568 r39602 397 397 398 398 #ifdef CHROMIUM_THREADSAFE 399 crTSDRefInit(context, stubContextDtor);399 VBoxTlsRefInit(context, stubContextDtor); 400 400 #endif 401 401 … … 1192 1192 } 1193 1193 1194 crTSDRefRelease(context);1194 VBoxTlsRefRelease(context); 1195 1195 #else 1196 1196 stubDestroyContextLocked(context); -
trunk/src/VBox/Additions/common/crOpenGL/load.c
r39568 r39602 27 27 # include <unistd.h> 28 28 #endif 29 #ifdef CHROMIUM_THREADSAFE30 #include "cr_threads.h"31 #endif32 29 33 30 #ifdef VBOX_WITH_WDDM … … 69 66 Stub stub; 70 67 #ifdef CHROMIUM_THREADSAFE 68 static bool g_stubIsCurrentContextTSDInited; 71 69 CRtsd g_stubCurrentContextTSD; 72 70 #endif … … 510 508 exit(0); /* this causes stubExitHandler() to be called */ 511 509 } 510 511 #ifndef RT_OS_WINDOWS 512 # ifdef CHROMIUM_THREADSAFE 513 static DECLCALLBACK(void) stubThreadTlsDtor(void *pvValue) 514 { 515 ContextInfo *pCtx = (ContextInfo*)pvValue; 516 VBoxTlsRefRelease(pCtx); 517 } 518 # endif 519 #endif 512 520 513 521 … … 547 555 #ifndef RT_OS_WINDOWS 548 556 # ifdef CHROMIUM_THREADSAFE 549 crInitTSD(&g_stubCurrentContextTSD); 557 if (!g_stubIsCurrentContextTSDInited) 558 { 559 crInitTSDF(&g_stubCurrentContextTSD, stubThreadTlsDtor); 560 g_stubIsCurrentContextTSDInited = true; 561 } 550 562 # endif 551 563 #endif … … 1411 1423 stubSPUSafeTearDown(); 1412 1424 1425 #ifdef CHROMIUM_THREADSAFE 1426 crFreeTSD(&g_stubCurrentContextTSD); 1427 #endif 1428 1413 1429 #ifdef VDBG_VEHANDLER 1414 1430 vboxVDbgVEHandlerUnregister(); 1415 1431 #endif 1416 1417 1432 break; 1418 1433 } -
trunk/src/VBox/Additions/common/crOpenGL/stub.h
r39568 r39602 56 56 #endif 57 57 58 #ifdef CHROMIUM_THREADSAFE 59 # include <cr_threads.h> 60 #endif 58 61 /*#define VBOX_TEST_MEGOO*/ 59 62 … … 113 116 114 117 #ifdef CHROMIUM_THREADSAFE 115 CRTSDREFDATA118 VBOXTLSREFDATA 116 119 #endif 117 120 … … 265 268 266 269 #ifdef CHROMIUM_THREADSAFE 267 # define stubGetCurrentContext() crTSDRefGetCurrent(ContextInfo, &g_stubCurrentContextTSD) 268 # define stubSetCurrentContext(_ctx) crTSDRefSetCurrent(ContextInfo, &g_stubCurrentContextTSD, _ctx) 269 #else 270 # define stubGetCurrentContext() (stub.currentContext) 271 # define stubSetCurrentContext(_ctx) do { stub.currentContext = (_ctx); } while (0) 272 #endif 273 274 extern Stub stub; 275 /* we place the __currentContextTSD outside the Stub data because Stub data is inited by the client's call, 276 * while we need __currentContextTSD the __currentContextTSD to be valid at any time to be able to handle 270 /* we place the g_stubCurrentContextTLS outside the Stub data because Stub data is inited by the client's call, 271 * while we need g_stubCurrentContextTLS the g_stubCurrentContextTLS to be valid at any time to be able to handle 277 272 * THREAD_DETACH cleanup on windows. 278 273 * Note that we can not do … … 284 279 * Note that GetModuleFileName acquires the loader lock. 285 280 * */ 286 #ifdef CHROMIUM_THREADSAFE287 281 extern CRtsd g_stubCurrentContextTSD; 288 #endif 282 283 # define stubGetCurrentContext() VBoxTlsRefGetCurrent(ContextInfo, &g_stubCurrentContextTSD) 284 # define stubSetCurrentContext(_ctx) VBoxTlsRefSetCurrent(ContextInfo, &g_stubCurrentContextTSD, _ctx) 285 #else 286 # define stubGetCurrentContext() (stub.currentContext) 287 # define stubSetCurrentContext(_ctx) do { stub.currentContext = (_ctx); } while (0) 288 #endif 289 290 extern Stub stub; 291 289 292 extern DECLEXPORT(SPUDispatchTable) glim; 290 293 extern SPUDispatchTable stubThreadsafeDispatch;
Note:
See TracChangeset
for help on using the changeset viewer.