Changeset 39568 in vbox
- Timestamp:
- Dec 9, 2011 1:52:31 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 75322
- Location:
- trunk/src/VBox
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/context.c
r37986 r39568 309 309 } 310 310 311 static void stubWindowCheckOwnerCB(unsigned long key, void *data1, void *data2); 312 313 static void 314 stubDestroyContextLocked( ContextInfo *context ) 315 { 316 unsigned long contextId = context->id; 317 if (context->type == NATIVE) { 318 #ifdef WINDOWS 319 stub.wsInterface.wglDeleteContext( context->hglrc ); 320 #elif defined(Darwin) 321 stub.wsInterface.CGLDestroyContext( context->cglc ); 322 #elif defined(GLX) 323 stub.wsInterface.glXDestroyContext( context->dpy, context->glxContext ); 324 #endif 325 } 326 else if (context->type == CHROMIUM) { 327 /* Have pack SPU or tilesort SPU, etc. destroy the context */ 328 CRASSERT(context->spuContext >= 0); 329 stub.spu->dispatch_table.DestroyContext( context->spuContext ); 330 crHashtableWalk(stub.windowTable, stubWindowCheckOwnerCB, context); 331 } 332 333 #ifdef GLX 334 crFreeHashtable(context->pGLXPixmapsHash, crFree); 335 if (context->damageDpy) 336 { 337 XCloseDisplay(context->damageDpy); 338 } 339 #endif 340 341 crMemZero(context, sizeof(ContextInfo)); /* just to be safe */ 342 crHashtableDelete(stub.contextTable, contextId, crFree); 343 } 344 345 #ifdef CHROMIUM_THREADSAFE 346 static DECLCALLBACK(void) stubContextDtor(void*pvContext) 347 { 348 crHashtableLock(stub.contextTable); 349 stubDestroyContextLocked((ContextInfo*)pvContext); 350 crHashtableUnlock(stub.contextTable); 351 } 352 #endif 311 353 312 354 /** … … 353 395 crStrncpy(context->dpyName, dpyName, MAX_DPY_NAME); 354 396 context->dpyName[MAX_DPY_NAME-1] = 0; 397 398 #ifdef CHROMIUM_THREADSAFE 399 crTSDRefInit(context, stubContextDtor); 400 #endif 355 401 356 402 #if defined(GLX) || defined(DARWIN) … … 925 971 926 972 if (!context || !window) { 927 if (stub.currentContext) 928 stub.currentContext->currentDrawable = NULL; 973 ContextInfo * currentContext = stubGetCurrentContext(); 974 if (currentContext) 975 currentContext->currentDrawable = NULL; 929 976 if (context) 930 977 context->currentDrawable = NULL; 931 stub .currentContext = NULL;978 stubSetCurrentContext(NULL); 932 979 return GL_TRUE; /* OK */ 933 980 } … … 1062 1109 window->pOwner = context; 1063 1110 context->currentDrawable = window; 1064 stub .currentContext = context;1111 stubSetCurrentContext(context); 1065 1112 1066 1113 if (retVal) { … … 1140 1187 CRASSERT(context); 1141 1188 1142 if (context->type == NATIVE) { 1143 #ifdef WINDOWS 1144 stub.wsInterface.wglDeleteContext( context->hglrc ); 1145 #elif defined(Darwin) 1146 stub.wsInterface.CGLDestroyContext( context->cglc ); 1147 #elif defined(GLX) 1148 stub.wsInterface.glXDestroyContext( context->dpy, context->glxContext ); 1149 #endif 1150 } 1151 else if (context->type == CHROMIUM) { 1152 /* Have pack SPU or tilesort SPU, etc. destroy the context */ 1153 CRASSERT(context->spuContext >= 0); 1154 stub.spu->dispatch_table.DestroyContext( context->spuContext ); 1155 crHashtableWalk(stub.windowTable, stubWindowCheckOwnerCB, context); 1156 } 1157 1158 if (stub.currentContext == context) { 1159 stub.currentContext = NULL; 1160 } 1161 1162 #ifdef GLX 1163 crFreeHashtable(context->pGLXPixmapsHash, crFree); 1164 if (context->damageDpy) 1165 { 1166 XCloseDisplay(context->damageDpy); 1167 } 1168 #endif 1169 1170 crMemZero(context, sizeof(ContextInfo)); /* just to be safe */ 1171 crHashtableDelete(stub.contextTable, contextId, crFree); 1172 1189 #ifdef CHROMIUM_THREADSAFE 1190 if (stubGetCurrentContext() == context) { 1191 stubSetCurrentContext(NULL); 1192 } 1193 1194 crTSDRefRelease(context); 1195 #else 1196 stubDestroyContextLocked(context); 1197 1198 if (stubGetCurrentContext() == context) { 1199 stubSetCurrentContext(NULL); 1200 } 1201 #endif 1173 1202 crHashtableUnlock(stub.contextTable); 1174 1203 } -
trunk/src/VBox/Additions/common/crOpenGL/glx.c
r37986 r39568 1043 1043 DECLEXPORT(GLXContext) VBOXGLXTAG(glXGetCurrentContext)( void ) 1044 1044 { 1045 if (stub.currentContext) 1046 return (GLXContext) stub.currentContext->id; 1045 ContextInfo *context = stubGetCurrentContext(); 1046 if (context) 1047 return (GLXContext) context->id; 1047 1048 else 1048 1049 return (GLXContext) NULL; … … 1182 1183 DECLEXPORT(void) VBOXGLXTAG(glXUseXFont)( Font font, int first, int count, int listBase ) 1183 1184 { 1184 if (stub.currentContext->type == CHROMIUM) 1185 ContextInfo *context = stubGetCurrentContext(); 1186 if (context->type == CHROMIUM) 1185 1187 { 1186 1188 Display *dpy = stub.wsInterface.glXGetCurrentDisplay(); … … 1201 1203 DECLEXPORT(void) VBOXGLXTAG(glXUseXFont)( Font font, int first, int count, int listBase ) 1202 1204 { 1203 Display *dpy = stub.currentContext->dpy; 1205 ContextInfo *context = stubGetCurrentContext(); 1206 Display *dpy = context->dpy; 1204 1207 if (dpy) { 1205 1208 stubUseXFont( dpy, font, first, count, listBase ); … … 2479 2482 if (event->type==damage_evb+XDamageNotify) 2480 2483 { 2484 ContextInfo *context = stubGetCurrentContext(); 2481 2485 XDamageNotifyEvent *e = (XDamageNotifyEvent *) event; 2482 2486 /* we're interested in pixmaps only...and those have e->drawable set to 0 or other strange value for some odd reason … … 2486 2490 (unsigned int) e->drawable, (unsigned int) e->damage, (int) e->level, 2487 2491 e->area.x, e->area.y, e->area.width, e->area.height);*/ 2488 CRASSERT( stub.currentContext);2489 crHashtableWalk( stub.currentContext->pGLXPixmapsHash, checkdamageCB, e);2492 CRASSERT(context); 2493 crHashtableWalk(context->pGLXPixmapsHash, checkdamageCB, e); 2490 2494 } 2491 2495 return False; … … 2498 2502 static int cnt=0; 2499 2503 XImage dummyimg; 2504 ContextInfo *context = stubGetCurrentContext(); 2500 2505 2501 2506 GLX_Pixmap_t *pGlxPixmap; 2502 2507 2503 if (! stub.currentContext)2508 if (!context) 2504 2509 { 2505 2510 crWarning("glXBindTexImageEXT called without current context"); … … 2507 2512 } 2508 2513 2509 pGlxPixmap = (GLX_Pixmap_t *) crHashtableSearch( stub.currentContext->pGLXPixmapsHash, (unsigned int) draw);2514 pGlxPixmap = (GLX_Pixmap_t *) crHashtableSearch(context->pGLXPixmapsHash, (unsigned int) draw); 2510 2515 if (!pGlxPixmap) 2511 2516 { … … 2516 2521 return; 2517 2522 } 2518 pGlxPixmap = stubInitGlxPixmap(pGlxPixmap, dpy, draw, stub.currentContext);2523 pGlxPixmap = stubInitGlxPixmap(pGlxPixmap, dpy, draw, context); 2519 2524 if (!pGlxPixmap) 2520 2525 { … … 2525 2530 2526 2531 /* If there's damage extension, then process incoming events as we need the information right now */ 2527 if ( stub.currentContext->damageDpy)2532 if (context->damageDpy) 2528 2533 { 2529 2534 /* Sync connections, note that order of syncs is important here. … … 2532 2537 XSync(dpy, False); 2533 2538 XUNLOCK(dpy); 2534 XSync( stub.currentContext->damageDpy, False);2535 2536 while (XPending( stub.currentContext->damageDpy))2539 XSync(context->damageDpy, False); 2540 2541 while (XPending(context->damageDpy)) 2537 2542 { 2538 2543 XEvent event; 2539 XNextEvent( stub.currentContext->damageDpy, &event);2540 if (event.type== stub.currentContext->damageEventsBase+XDamageNotify)2544 XNextEvent(context->damageDpy, &event); 2545 if (event.type==contextt->damageEventsBase+XDamageNotify) 2541 2546 { 2542 crHashtableWalk( stub.currentContext->pGLXPixmapsHash, stubCheckXDamageCB, &event);2547 crHashtableWalk(contextt->pGLXPixmapsHash, stubCheckXDamageCB, &event); 2543 2548 } 2544 2549 } … … 2590 2595 { 2591 2596 /* Check if we have damage extension */ 2592 if ( stub.currentContext->damageDpy)2597 if (context->damageDpy) 2593 2598 { 2594 2599 if (pGlxPixmap->bPixmapImageDirty) -
trunk/src/VBox/Additions/common/crOpenGL/load.c
r39485 r39568 68 68 /* NOTE: 'SPUDispatchTable stubThreadsafeDispatch' is declared in tsfuncs.c */ 69 69 Stub stub; 70 #ifdef CHROMIUM_THREADSAFE 71 CRtsd g_stubCurrentContextTSD; 72 #endif 70 73 71 74 … … 201 204 static void stubCheckWindowsState(void) 202 205 { 206 ContextInfo *context = stubGetCurrentContext(); 207 203 208 CRASSERT(stub.trackWindowSize || stub.trackWindowPos); 204 209 205 if (! stub.currentContext)210 if (!context) 206 211 return; 207 212 … … 215 220 #endif 216 221 217 stubCheckWindowState( stub.currentContext->currentDrawable, GL_TRUE);218 crHashtableWalk(stub.windowTable, stubCheckWindowsCB, stub.currentContext);222 stubCheckWindowState(context->currentDrawable, GL_TRUE); 223 crHashtableWalk(stub.windowTable, stubCheckWindowsCB, context); 219 224 220 225 #if defined(CR_NEWWINTRACK) && !defined(WINDOWS) … … 250 255 else 251 256 { 257 ContextInfo *context = stubGetCurrentContext(); 252 258 int winX, winY; 253 259 unsigned int winW, winH; 254 260 WindowInfo *pWindow; 255 pWindow = stub.currentContext->currentDrawable;261 pWindow = context->currentDrawable; 256 262 stubGetWindowGeometry(pWindow, &winX, &winY, &winW, &winH); 257 263 origViewport(0, 0, winW, winH); … … 276 282 unsigned int winW, winH; 277 283 WindowInfo *pWindow; 278 pWindow = stub.currentContext->currentDrawable; 284 ContextInfo *context = stubGetCurrentContext(); 285 pWindow = context->currentDrawable; 279 286 stubGetWindowGeometry(pWindow, &winX, &winY, &winW, &winH); 280 287 origScissor(0, 0, winW, winH); … … 538 545 stub.freeContextNumber = MAGIC_CONTEXT_BASE; 539 546 stub.contextTable = crAllocHashtable(); 540 stub.currentContext = NULL; 547 #ifndef RT_OS_WINDOWS 548 # ifdef CHROMIUM_THREADSAFE 549 crInitTSD(&g_stubCurrentContextTSD); 550 # endif 551 #endif 552 stubSetCurrentContext(NULL); 541 553 542 554 stub.windowTable = crAllocHashtable(); … … 1367 1379 CRNetServer ns; 1368 1380 1381 #ifdef CHROMIUM_THREADSAFE 1382 crInitTSD(&g_stubCurrentContextTSD); 1383 #endif 1384 1369 1385 crInitMutex(&stub_init_mutex); 1370 1386 … … 1402 1418 } 1403 1419 1420 case DLL_THREAD_ATTACH: 1421 { 1404 1422 #if 0 1405 case DLL_THREAD_ATTACH:1406 {1407 1423 if (stub_initialized) 1408 1424 { … … 1410 1426 stub.spu->dispatch_table.VBoxPackAttachThread(); 1411 1427 } 1428 #endif 1412 1429 break; 1413 1430 } … … 1415 1432 case DLL_THREAD_DETACH: 1416 1433 { 1434 stubSetCurrentContext(NULL); 1435 #if 0 1417 1436 if (stub_initialized) 1418 1437 { … … 1420 1439 stub.spu->dispatch_table.VBoxPackDetachThread(); 1421 1440 } 1441 #endif 1422 1442 break; 1423 1443 } 1424 #endif1425 1444 1426 1445 default: -
trunk/src/VBox/Additions/common/crOpenGL/stub.c
r37986 r39568 88 88 GLint APIENTRY crGetCurrentContext( void ) 89 89 { 90 ContextInfo *context; 90 91 stubInit(); 91 if (stub.currentContext) 92 return (GLint) stub.currentContext->id; 92 context = stubGetCurrentContext(); 93 if (context) 94 return (GLint) context->id; 93 95 else 94 96 return 0; … … 97 99 GLint APIENTRY crGetCurrentWindow( void ) 98 100 { 101 ContextInfo *context; 99 102 stubInit(); 100 if (stub.currentContext && stub.currentContext->currentDrawable) 101 return stub.currentContext->currentDrawable->spuWindow; 103 context = stubGetCurrentContext(); 104 if (context && context->currentDrawable) 105 return context->currentDrawable->spuWindow; 102 106 else 103 107 return -1; -
trunk/src/VBox/Additions/common/crOpenGL/stub.h
r34295 r39568 111 111 GLint visBits; 112 112 WindowInfo *currentDrawable; 113 114 #ifdef CHROMIUM_THREADSAFE 115 CRTSDREFDATA 116 #endif 113 117 114 118 #ifdef WINDOWS … … 225 229 int freeContextNumber; 226 230 CRHashTable *contextTable; 231 #ifndef CHROMIUM_THREADSAFE 227 232 ContextInfo *currentContext; /* may be NULL */ 233 #endif 228 234 229 235 /* windows */ … … 258 264 } Stub; 259 265 266 #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 260 273 261 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 277 * THREAD_DETACH cleanup on windows. 278 * Note that we can not do 279 * STUB_INIT_LOCK(); 280 * if (stub_initialized) stubSetCurrentContext(NULL); 281 * STUB_INIT_UNLOCK(); 282 * on THREAD_DETACH since it may cause deadlock, i.e. in this situation loader lock is acquired first and then the init lock, 283 * but since we use GetModuleFileName in crGetProcName called from stubInitLocked, the lock order might be the oposite. 284 * Note that GetModuleFileName acquires the loader lock. 285 * */ 286 #ifdef CHROMIUM_THREADSAFE 287 extern CRtsd g_stubCurrentContextTSD; 288 #endif 262 289 extern DECLEXPORT(SPUDispatchTable) glim; 263 290 extern SPUDispatchTable stubThreadsafeDispatch; -
trunk/src/VBox/Additions/common/crOpenGL/wgl.c
r38244 r39568 186 186 HGLRC WINAPI wglGetCurrentContext_prox( void ) 187 187 { 188 return (HGLRC) (stub.currentContext ? stub.currentContext->id : 0); 188 ContextInfo *context = stubGetCurrentContext(); 189 return (HGLRC) (context ? context->id : 0); 189 190 } 190 191 191 192 HDC WINAPI wglGetCurrentDC_prox( void ) 192 193 { 193 if (stub.currentContext && stub.currentContext->currentDrawable) 194 return (HDC) stub.currentContext->currentDrawable->drawable; 194 ContextInfo *context = stubGetCurrentContext(); 195 if (context && context->currentDrawable) 196 return (HDC) context->currentDrawable->drawable; 195 197 else 196 198 return (HDC) NULL; -
trunk/src/VBox/GuestHost/OpenGL/include/cr_glstate.h
r39507 r39568 46 46 #include "spu_dispatch_table.h" 47 47 48 #ifdef CHROMIUM_THREADSAFE 49 #include "cr_threads.h" 50 #endif 51 48 52 #include <iprt/cdefs.h> 49 53 … … 129 133 * => Thread2 still refers to destroyed ctx1 130 134 * */ 131 /* number of threads that have context set as current */ 132 volatile int cRefs; 135 CRTSDREFDATA 133 136 #endif 134 137 -
trunk/src/VBox/GuestHost/OpenGL/include/cr_threads.h
r15532 r39568 25 25 #endif 26 26 27 27 #include <iprt/asm.h> 28 28 /* 29 29 * Handle for Thread-Specific Data … … 101 101 extern DECLEXPORT(void) crSignalSemaphore(CRsemaphore *s); 102 102 103 typedef DECLCALLBACK(void) FNCRTSDREFDTOR(void*); 104 typedef FNCRTSDREFDTOR *PFNCRTSDREFDTOR; 103 105 106 typedef enum { 107 CRTSDREFDATA_STATE_UNDEFINED = 0, 108 CRTSDREFDATA_STATE_INITIALIZED, 109 CRTSDREFDATA_STATE_TOBE_DESTROYED, 110 CRTSDREFDATA_STATE_DESTROYING, 111 CRTSDREFDATA_STATE_32BIT_HACK = 0x7fffffff 112 } CRTSDREFDATA_STATE; 113 114 #define CRTSDREFDATA \ 115 volatile uint32_t cTsdRefs; \ 116 uint32_t enmTsdRefState; \ 117 PFNCRTSDREFDTOR pfnTsdRefDtor; \ 118 119 #define crTSDRefInit(_p, _pfnDtor) do { \ 120 (_p)->cTsdRefs = 1; \ 121 (_p)->enmTsdRefState = CRTSDREFDATA_STATE_INITIALIZED; \ 122 (_p)->pfnTsdRefDtor = (_pfnDtor); \ 123 } while (0) 124 125 #define crTSDRefIsFunctional(_p) (!!((_p)->enmTsdRefState == CRTSDREFDATA_STATE_INITIALIZED)) 126 127 #define crTSDRefAddRef(_p) do { \ 128 int cRefs = ASMAtomicIncS32(&(_p)->cTsdRefs); \ 129 CRASSERT(cRefs > 1 || (_p)->enmTsdRefState == CRTSDREFDATA_STATE_DESTROYING); \ 130 } while (0) 131 132 #define crTSDRefRelease(_p) do { \ 133 int cRefs = ASMAtomicDecS32(&(_p)->cTsdRefs); \ 134 CRASSERT(cRefs >= 0); \ 135 if (!cRefs && (_p)->enmTsdRefState != CRTSDREFDATA_STATE_DESTROYING /* <- avoid recursion if crTSDRefAddRef/Release is called from dtor */) { \ 136 (_p)->enmTsdRefState = CRTSDREFDATA_STATE_DESTROYING; \ 137 (_p)->pfnTsdRefDtor((_p)); \ 138 } \ 139 } while (0) 140 141 #define crTSDRefReleaseMarkDestroy(_p) do { \ 142 (_p)->enmTsdRefState = CRTSDREFDATA_STATE_TOBE_DESTROYED; \ 143 } while (0) 144 145 #define crTSDRefGetCurrent(_t, _pTsd) ((_t*) crGetTSD((_pTsd))) 146 147 #define crTSDRefSetCurrent(_t, _pTsd, _p) do { \ 148 _t * oldCur = crTSDRefGetCurrent(_t, _pTsd); \ 149 if (oldCur != (_p)) { \ 150 crSetTSD((_pTsd), (_p)); \ 151 if (oldCur) { \ 152 crTSDRefRelease(oldCur); \ 153 } \ 154 if ((_p)) { \ 155 crTSDRefAddRef((_t*)(_p)); \ 156 } \ 157 } \ 158 } while (0) 104 159 #ifdef __cplusplus 105 160 } -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state.h
r39507 r39568 11 11 #ifdef CHROMIUM_THREADSAFE 12 12 #include "cr_threads.h" 13 #include <iprt/asm.h>14 13 #endif 15 14 … … 25 24 #ifdef CHROMIUM_THREADSAFE 26 25 extern CRtsd __contextTSD; 27 #define GetCurrentContext() (CRContext *) crGetTSD(&__contextTSD)26 #define GetCurrentContext() crTSDRefGetCurrent(CRContext, &__contextTSD) 28 27 29 /* NOTE: below ref &SetCurrentContext stuff is supposed to be used only internally!!28 /* NOTE: below SetCurrentContext stuff is supposed to be used only internally!! 30 29 * it is placed here only to simplify things since some code besides state_init.c 31 30 * (i.e. state_glsl.c) is using it */ 32 void crStateFreeContext(CRContext *ctx); 33 #define CRCONTEXT_ADDREF(_ctx) do { \ 34 int cRefs = ASMAtomicIncS32(&((CRContext*)(_ctx))->cRefs); \ 35 CRASSERT(cRefs > 1); \ 36 } while (0) 37 #define CRCONTEXT_RELEASE(_ctx) do { \ 38 int cRefs = ASMAtomicDecS32(&((CRContext*)(_ctx))->cRefs); \ 39 CRASSERT(cRefs >= 0); \ 40 if (!cRefs) { \ 41 crStateFreeContext((_ctx)); \ 42 } \ 43 } while (0) 44 #define SetCurrentContext(_ctx) do { \ 45 CRContext * oldCur = GetCurrentContext(); \ 46 if (oldCur != (_ctx)) { \ 47 if (oldCur) { \ 48 CRCONTEXT_RELEASE(oldCur); \ 49 } \ 50 if ((_ctx)) { \ 51 CRCONTEXT_ADDREF(_ctx); \ 52 } \ 53 crSetTSD(&__contextTSD, _ctx); \ 54 } \ 55 } while (0) 31 #define SetCurrentContext(_ctx) crTSDRefSetCurrent(CRContext, &__contextTSD, _ctx) 56 32 #else 57 33 extern CRContext *__currentContext; -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_glsl.c
r39529 r39568 174 174 as the current context isn't the one being destroyed*/ 175 175 #ifdef CHROMIUM_THREADSAFE 176 CRASSERT( !ctx->cRefs);177 ++ctx->cRefs; /* <- this is a hack to avoid subsequent SetCurrentContext(g) do recursive Destroy for ctx */176 CRASSERT(g != ctx); 177 crTSDRefAddRef(ctx); /* <- this is a hack to avoid subsequent SetCurrentContext(g) do recursive Destroy for ctx */ 178 178 if (g) 179 CRCONTEXT_ADDREF(g); /* <- ensure the g is not destroyed by the following SetCurrentContext call */179 crTSDRefAddRef(g); /* <- ensure the g is not destroyed by the following SetCurrentContext call */ 180 180 SetCurrentContext(ctx); 181 181 #else … … 189 189 SetCurrentContext(g); 190 190 if (g) 191 CRCONTEXT_RELEASE(g);192 --ctx->cRefs; /* <- restore back the cRefs (see above) */191 crTSDRefRelease(g); 192 crTSDRefRelease(ctx); /* <- restore back the cRefs (see above) */ 193 193 #else 194 194 __currentContext = g; -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_init.c
r39507 r39568 145 145 } 146 146 147 #ifdef CHROMIUM_THREADSAFE 148 static void 149 crStateFreeContext(CRContext *ctx); 150 static DECLCALLBACK(void) crStateContextDtor(void *pvCtx) 151 { 152 crStateFreeContext((CRContext*)pvCtx); 153 } 154 #endif 155 147 156 /* 148 157 * Helper for crStateCreateContext, below. … … 159 168 ctx->id = i; 160 169 #ifdef CHROMIUM_THREADSAFE 161 c tx->cRefs = 1;170 crTSDRefInit(ctx, crStateContextDtor); 162 171 #endif 163 172 ctx->flush_func = NULL; … … 261 270 262 271 /*@todo crStateAttribDestroy*/ 263 void272 static void 264 273 crStateFreeContext(CRContext *ctx) 265 274 { … … 312 321 #ifdef CHROMIUM_THREADSAFE 313 322 SetCurrentContext(NULL); 314 CRCONTEXT_RELEASE(defaultContext);323 crTSDRefRelease(defaultContext); 315 324 #else 316 325 crStateFreeContext(defaultContext); … … 448 457 449 458 #ifdef CHROMIUM_THREADSAFE 450 CRCONTEXT_RELEASE(ctx);459 crTSDRefRelease(ctx); 451 460 #else 452 461 crStateFreeContext(ctx);
Note:
See TracChangeset
for help on using the changeset viewer.