Changeset 64727 in vbox
- Timestamp:
- Nov 21, 2016 11:43:03 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r64671 r64727 3233 3233 if (cIoReqsWaiting > 0) 3234 3234 { 3235 RTLISTANCHOR LstIoReqProcess; 3236 RTListInit(&LstIoReqProcess); 3237 3235 3238 /* Try to process as many requests as possible. */ 3236 3239 RTCritSectEnter(&pThis->CritSectIoReqsIoBufWait); … … 3255 3258 pIoReqCur->ReadWrite.pSgBuf = &pIoReqCur->ReadWrite.IoBuf.SgBuf; 3256 3259 3257 bool fXchg = ASMAtomicCmpXchgU32((volatile uint32_t *)&pIoReqCur->enmState, VDIOREQSTATE_ACTIVE, VDIOREQSTATE_ALLOCATED); 3258 if (RT_UNLIKELY(!fXchg)) 3259 { 3260 /* Must have been canceled inbetween. */ 3261 Assert(pIoReqCur->enmState == VDIOREQSTATE_CANCELED); 3262 drvvdMediaExIoReqCompleteWorker(pThis, pIoReqCur, VERR_PDM_MEDIAEX_IOREQ_CANCELED, true /* fUpNotify */); 3263 } 3264 ASMAtomicIncU32(&pThis->cIoReqsActive); 3265 rc = drvvdMediaExIoReqReadWriteProcess(pThis, pIoReqCur, true /* fUpNotify */); 3260 RTListAppend(&LstIoReqProcess, &pIoReqCur->NdLstWait); 3266 3261 } 3267 3262 else … … 3274 3269 3275 3270 ASMAtomicAddU32(&pThis->cIoReqsWaiting, cIoReqsWaiting); 3271 3272 /* Process the requests we could allocate memory for outside the lock now. */ 3273 RTListForEachSafe(&LstIoReqProcess, pIoReqCur, pIoReqNext, PDMMEDIAEXIOREQINT, NdLstWait) 3274 { 3275 RTListNodeRemove(&pIoReqCur->NdLstWait); 3276 3277 bool fXchg = ASMAtomicCmpXchgU32((volatile uint32_t *)&pIoReqCur->enmState, VDIOREQSTATE_ACTIVE, VDIOREQSTATE_ALLOCATED); 3278 if (RT_UNLIKELY(!fXchg)) 3279 { 3280 /* Must have been canceled inbetween. */ 3281 Assert(pIoReqCur->enmState == VDIOREQSTATE_CANCELED); 3282 drvvdMediaExIoReqCompleteWorker(pThis, pIoReqCur, VERR_PDM_MEDIAEX_IOREQ_CANCELED, true /* fUpNotify */); 3283 } 3284 ASMAtomicIncU32(&pThis->cIoReqsActive); 3285 drvvdMediaExIoReqReadWriteProcess(pThis, pIoReqCur, true /* fUpNotify */); 3286 } 3276 3287 } 3277 3288 }
Note:
See TracChangeset
for help on using the changeset viewer.