Changeset 37818 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Jul 7, 2011 1:25:03 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/log/log.cpp
r37605 r37818 1060 1060 RT_EXPORT_SYMBOL(RTLogSetCustomPrefixCallbackForR0); 1061 1061 1062 RTDECL(void) RTLogFlushR0(PRTLOGGER pLogger, PRTLOGGER pLoggerR0) 1063 { 1064 /* 1065 * Resolve defaults. 1066 */ 1067 if (!pLogger) 1068 { 1069 pLogger = RTLogDefaultInstance(); 1070 if (!pLogger) 1071 { 1072 /* flushing to "/dev/null". */ 1073 if (pLoggerR0->offScratch) 1074 pLoggerR0->offScratch = 0; 1075 return; 1076 } 1077 } 1078 1079 /* 1080 * Any thing to flush? 1081 */ 1082 if ( pLoggerR0->offScratch 1083 || pLogger->offScratch) 1084 { 1085 /* 1086 * Acquire logger semaphores. 1087 */ 1088 int rc = rtlogLock(pLogger); 1089 if (RT_FAILURE(rc)) 1090 return; 1091 if (RT_SUCCESS(rc)) 1092 { 1093 /* 1094 * Write whatever the GC instance contains to the HC one, and then 1095 * flush the HC instance. 1096 */ 1097 if (pLoggerR0->offScratch) 1098 { 1099 rtLogOutput(pLogger, pLoggerR0->achScratch, pLoggerR0->offScratch); 1100 rtLogOutput(pLogger, NULL, 0); 1101 pLoggerR0->offScratch = 0; 1102 } 1103 } 1104 rtlogUnlock(pLogger); 1105 } 1106 } 1107 RT_EXPORT_SYMBOL(RTLogFlushR0); 1108 1062 1109 # endif /* IN_RING3 */ 1063 1110 … … 1089 1136 { 1090 1137 pSrcLogger->offScratch = 0; 1091 rtlog Lock(pSrcLogger);1138 rtlogUnlock(pSrcLogger); 1092 1139 } 1093 1140 }
Note:
See TracChangeset
for help on using the changeset viewer.