- Timestamp:
- Oct 7, 2009 6:29:34 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 53274
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/fileaio-posix.cpp
r23411 r23602 277 277 278 278 ASMAtomicDecS32(&pCtxInt->cRequests); 279 AssertMsg(pCtxInt->cRequests >= 0, ("Canceled request not which is not in this context\n")); 279 280 RTSemEventSignal(pCtxInt->SemEventCancel); 280 281 } … … 650 651 if (RT_UNLIKELY(rcPosix < 0)) 651 652 { 653 size_t cReqsSubmitted = cReqsSubmit; 654 652 655 if (errno == EAGAIN) 653 656 rc = VERR_FILE_AIO_INSUFFICIENT_RESSOURCES; … … 656 659 657 660 /* Check which ones were not submitted. */ 658 for (i = 0; i < cReqs ; i++)661 for (i = 0; i < cReqsSubmit; i++) 659 662 { 660 663 pReqInt = pahReqs[i]; … … 664 667 if ((rcPosix != EINPROGRESS) && (rcPosix != 0)) 665 668 { 666 cReqsSubmit --;669 cReqsSubmitted--; 667 670 668 671 #if defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD) … … 703 706 else 704 707 pHead = pNext; 708 709 pReqInt->pNext = NULL; 710 pReqInt->pPrev = NULL; 705 711 } 706 712 } 707 713 ASMAtomicAddS32(&pCtxInt->cRequests, cReqsSubmitted); 714 AssertMsg(pCtxInt->cRequests > 0, ("Adding requests resulted in overflow\n")); 708 715 break; 709 716 } 710 717 711 718 ASMAtomicAddS32(&pCtxInt->cRequests, cReqsSubmit); 719 AssertMsg(pCtxInt->cRequests > 0, ("Adding requests resulted in overflow\n")); 712 720 cReqs -= cReqsSubmit; 713 721 pahReqs += cReqsSubmit; … … 720 728 * above. 721 729 */ 722 if (cReqs )730 if (cReqs && RT_SUCCESS_NP(rc)) 723 731 { 724 732 pReqInt = pahReqs[0]; 725 733 RTFILEAIOREQ_VALID_RETURN(pReqInt); 726 727 734 728 735 if (pReqInt->fFlush) … … 754 761 755 762 ASMAtomicIncS32(&pCtxInt->cRequests); 763 AssertMsg(pCtxInt->cRequests > 0, ("Adding requests resulted in overflow\n")); 756 764 cReqs--; 757 765 pahReqs++; 758 766 } 759 767 } 760 } while (cReqs); 768 } while ( cReqs 769 && RT_SUCCESS_NP(rc)); 761 770 762 771 if (pHead) … … 815 824 AssertReturn(cReqs >= cMinReqs, VERR_OUT_OF_RANGE); 816 825 817 if (RT_UNLIKELY(ASMAtomicReadS32(&pCtxInt->cRequests) == 0)) 826 int32_t cRequestsWaiting = ASMAtomicReadS32(&pCtxInt->cRequests); 827 828 if (RT_UNLIKELY(cRequestsWaiting == 0)) 818 829 return VERR_FILE_AIO_NO_REQUEST; 830 831 if (RT_UNLIKELY(cMinReqs > cRequestsWaiting)) 832 return VERR_INVALID_PARAMETER; 819 833 820 834 if (cMillisTimeout != RT_INDEFINITE_WAIT) … … 945 959 ASMAtomicSubS32(&pCtxInt->cRequests, cDone); 946 960 961 AssertMsg(pCtxInt->cRequests >= 0, ("Finished more requests than currently active\n")); 962 947 963 if (!cMinReqs) 948 964 break;
Note:
See TracChangeset
for help on using the changeset viewer.