- 時間撮記:
- 2014-6-5 下午09:18:41 (10 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_init.c
r51005 r51559 9 9 #include "cr_error.h" 10 10 #include "cr_spu.h" 11 12 #include <iprt/asm.h> 11 13 12 14 #ifdef CHROMIUM_THREADSAFE … … 110 112 crStateFreeShared(CRContext *pContext, CRSharedState *s) 111 113 { 112 s->refCount--; 113 Assert(s->refCount >= 0); 114 if (s->refCount <= 0) { 114 int32_t refCount = ASMAtomicDecS32(&s->refCount); 115 116 Assert(refCount >= 0); 117 if (refCount <= 0) { 115 118 if (s==gSharedState) 116 119 { … … 144 147 return NULL; 145 148 } 146 gSharedState->refCount++;149 ASMAtomicIncS32(&gSharedState->refCount); 147 150 return gSharedState; 148 151 } … … 176 179 crStateFreeShared(pCtx, pCtx->shared); 177 180 pCtx->shared = gSharedState; 178 gSharedState->refCount++;181 ASMAtomicIncS32(&gSharedState->refCount); 179 182 } 180 183 } … … 199 202 } 200 203 } 204 } 205 206 DECLEXPORT(void) STATE_APIENTRY 207 crStateShareLists(CRContext *pContext1, CRContext *pContext2) 208 { 209 CRASSERT(pContext1->shared); 210 CRASSERT(pContext2->shared); 211 212 if (pContext2->shared == pContext1->shared) 213 { 214 return; 215 } 216 217 crStateFreeShared(pContext1, pContext1->shared); 218 pContext1->shared = pContext2->shared; 219 ASMAtomicIncS32(&pContext2->shared->refCount); 201 220 } 202 221 … … 271 290 CRASSERT(shareCtx->shared); 272 291 ctx->shared = shareCtx->shared; 273 ctx->shared->refCount ++;292 ASMAtomicIncS32(&ctx->shared->refCount); 274 293 } 275 294 else {
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器