Changeset 19729 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- May 15, 2009 11:54:18 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/log/log.cpp
r18188 r19729 1476 1476 #ifdef IN_RING0 1477 1477 /** 1478 * Changes the default logger instance for the currentthread.1478 * Changes the default logger instance for the specified thread. 1479 1479 * 1480 1480 * @returns IPRT status code. 1481 * @param pLogger The logger instance. Pass NULL for deregistration. 1482 * @param uKey Associated key for cleanup purposes. If pLogger is NULL, 1483 * all instances with this key will be deregistered. So in 1484 * order to only deregister the instance associated with the 1485 * current thread use 0. 1486 */ 1487 RTDECL(int) RTLogSetDefaultInstanceThread(PRTLOGGER pLogger, uintptr_t uKey) 1481 * @param hNativeThread Thread handle 1482 * @param pLogger The logger instance. Pass NULL for deregistration. 1483 * @param uKey Associated key for cleanup purposes. If pLogger is NULL, 1484 * all instances with this key will be deregistered. So in 1485 * order to only deregister the instance associated with the 1486 * current thread use 0. 1487 */ 1488 RTDECL(int) RTLogSetDefaultInstanceThread(RTNATIVETHREAD hNativeThread, PRTLOGGER pLogger, uintptr_t uKey) 1488 1489 { 1489 1490 int rc; 1490 RTNATIVETHREAD Self = RTThreadNativeSelf();1491 1491 if (pLogger) 1492 1492 { … … 1501 1501 i = RT_ELEMENTS(g_aPerThreadLoggers); 1502 1502 while (i-- > 0) 1503 if (g_aPerThreadLoggers[i].NativeThread == Self)1503 if (g_aPerThreadLoggers[i].NativeThread == hNativeThread) 1504 1504 { 1505 1505 ASMAtomicXchgPtr((void * volatile *)&g_aPerThreadLoggers[i].uKey, (void *)uKey); … … 1525 1525 AssertCompile(sizeof(RTNATIVETHREAD) == sizeof(void*)); 1526 1526 if ( g_aPerThreadLoggers[i].NativeThread == NIL_RTNATIVETHREAD 1527 && ASMAtomicCmpXchgPtr((void * volatile *)&g_aPerThreadLoggers[i].NativeThread, (void *) Self, (void *)NIL_RTNATIVETHREAD))1527 && ASMAtomicCmpXchgPtr((void * volatile *)&g_aPerThreadLoggers[i].NativeThread, (void *)hNativeThread, (void *)NIL_RTNATIVETHREAD)) 1528 1528 { 1529 1529 ASMAtomicXchgPtr((void * volatile *)&g_aPerThreadLoggers[i].uKey, (void *)uKey); … … 1544 1544 int32_t i = RT_ELEMENTS(g_aPerThreadLoggers); 1545 1545 while (i-- > 0) 1546 if ( g_aPerThreadLoggers[i].NativeThread == Self1546 if ( g_aPerThreadLoggers[i].NativeThread == hNativeThread 1547 1547 || g_aPerThreadLoggers[i].uKey == uKey) 1548 1548 {
Note:
See TracChangeset
for help on using the changeset viewer.