Changeset 90969 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Aug 27, 2021 10:12:22 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 146608
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/log/log.cpp
r90866 r90969 3107 3107 static void rtlogFlush(PRTLOGGERINTERNAL pLoggerInt, bool fNeedSpace) 3108 3108 { 3109 PRTLOGBUFFERDESC constpBufDesc = pLoggerInt->pBufDesc;3110 uint32_t 3111 char * const 3112 uint32_t const 3109 PRTLOGBUFFERDESC pBufDesc = pLoggerInt->pBufDesc; 3110 uint32_t cchToFlush = pBufDesc->offBuf; 3111 char * const pchToFlush = pBufDesc->pchBuf; 3112 uint32_t const cbBuf = pBufDesc->cbBuf; 3113 3113 Assert(pBufDesc->u32Magic == RTLOGBUFFERDESC_MAGIC); 3114 3114 … … 3180 3180 if (pLoggerInt->pfnFlush) 3181 3181 { 3182 /** @todo implement asynchronous buffer switching protocol. */ 3183 bool fDone; 3182 /* 3183 * We have a custom flush callback. Before calling it we must make 3184 * sure the aux descriptor is up to date. When we get back, we may 3185 * need to switch to the next buffer if the current is being flushed 3186 * asynchronously. This of course requires there to be more than one 3187 * buffer. (The custom flush callback is responsible for making sure 3188 * the next buffer isn't being flushed before returning.) 3189 */ 3184 3190 if (pBufDesc->pAux) 3185 3191 pBufDesc->pAux->offBuf = cchToFlush; 3186 fDone = pLoggerInt->pfnFlush(&pLoggerInt->Core, pBufDesc); 3187 Assert(fDone == true); RT_NOREF(fDone); 3188 } 3189 3190 /* empty the buffer. */ 3192 if (!pLoggerInt->pfnFlush(&pLoggerInt->Core, pBufDesc)) 3193 { 3194 /* advance to the next buffer */ 3195 Assert(pLoggerInt->cBufDescs > 1); 3196 size_t idxBufDesc = pBufDesc - pLoggerInt->paBufDescs; 3197 Assert(idxBufDesc < pLoggerInt->cBufDescs); 3198 idxBufDesc = (idxBufDesc + 1) % pLoggerInt->cBufDescs; 3199 pLoggerInt->idxBufDesc = (uint8_t)idxBufDesc; 3200 pLoggerInt->pBufDesc = pBufDesc = &pLoggerInt->paBufDescs[idxBufDesc]; 3201 } 3202 } 3203 3204 /* Empty the buffer. */ 3191 3205 pBufDesc->offBuf = 0; 3192 3206 if (pBufDesc->pAux)
Note:
See TracChangeset
for help on using the changeset viewer.