Changeset 408 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Jan 28, 2007 10:46:05 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 17979
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/log.cpp
r192 r408 112 112 { 113 113 /** The thread. */ 114 RT THREAD volatileThread;114 RTNATIVETHREAD volatile NativeThread; 115 115 /** The (process / session) key. */ 116 uintptr_t volatile uKey;116 uintptr_t volatile uKey; 117 117 /** The logger instance.*/ 118 PRTLOGGER volatile pLogger;118 PRTLOGGER volatile pLogger; 119 119 } g_aPerThreadLoggers[8]; 120 120 #endif /* IN_RING0 */ … … 1250 1250 if (g_cPerThreadLoggers) 1251 1251 { 1252 const RT THREAD Self = RTThreadSelf();1252 const RTNATIVETHREAD Self = RTThreadNativeSelf(); 1253 1253 int32_t i = ELEMENTS(g_aPerThreadLoggers); 1254 1254 while (i-- > 0) 1255 if (g_aPerThreadLoggers[i]. Thread == Self)1255 if (g_aPerThreadLoggers[i].NativeThread == Self) 1256 1256 return g_aPerThreadLoggers[i].pLogger; 1257 1257 } … … 1281 1281 RTDECL(int) RTLogSetDefaultInstanceThread(PRTLOGGER pLogger, uintptr_t uKey) 1282 1282 { 1283 int rc;1284 RT THREAD Self = RTThreadSelf();1283 int rc; 1284 RTNATIVETHREAD Self = RTThreadNativeSelf(); 1285 1285 if (pLogger) 1286 1286 { … … 1292 1292 int32_t i = ELEMENTS(g_aPerThreadLoggers); 1293 1293 while (i-- > 0) 1294 if (g_aPerThreadLoggers[i]. Thread == Self)1294 if (g_aPerThreadLoggers[i].NativeThread == Self) 1295 1295 { 1296 1296 ASMAtomicXchgPtr((void * volatile *)&g_aPerThreadLoggers[i].uKey, (void *)uKey); … … 1314 1314 while (i-- > 0) 1315 1315 { 1316 AssertCompile(sizeof(RT THREAD) == sizeof(void*));1317 if ( g_aPerThreadLoggers[i]. Thread == NIL_RTTHREAD1318 && ASMAtomicCmpXchgPtr((void * volatile *)&g_aPerThreadLoggers[i]. Thread, Self, NIL_RTTHREAD))1316 AssertCompile(sizeof(RTNATIVETHREAD) == sizeof(void*)); 1317 if ( g_aPerThreadLoggers[i].NativeThread == NIL_RTTHREAD 1318 && ASMAtomicCmpXchgPtr((void * volatile *)&g_aPerThreadLoggers[i].NativeThread, (void *)Self, (void *)NIL_RTNATIVETHREAD)) 1319 1319 { 1320 1320 ASMAtomicXchgPtr((void * volatile *)&g_aPerThreadLoggers[i].uKey, (void *)uKey); … … 1335 1335 int32_t i = ELEMENTS(g_aPerThreadLoggers); 1336 1336 while (i-- > 0) 1337 if ( g_aPerThreadLoggers[i]. Thread == Self1337 if ( g_aPerThreadLoggers[i].NativeThread == Self 1338 1338 || g_aPerThreadLoggers[i].uKey == uKey) 1339 1339 { 1340 1340 ASMAtomicXchgPtr((void * volatile *)&g_aPerThreadLoggers[i].uKey, NULL); 1341 1341 ASMAtomicXchgPtr((void * volatile *)&g_aPerThreadLoggers[i].pLogger, NULL); 1342 ASMAtomicXchgPtr((void * volatile *)&g_aPerThreadLoggers[i]. Thread, NIL_RTTHREAD);1342 ASMAtomicXchgPtr((void * volatile *)&g_aPerThreadLoggers[i].NativeThread, (void *)NIL_RTNATIVETHREAD); 1343 1343 ASMAtomicDecS32(&g_cPerThreadLoggers); 1344 1344 }
Note:
See TracChangeset
for help on using the changeset viewer.