Changeset 25724 in vbox for trunk/src/VBox/Runtime/r3/win
- Timestamp:
- Jan 11, 2010 2:45:34 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56467
- Location:
- trunk/src/VBox/Runtime/r3/win
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/win/fileaio-win.cpp
r25645 r25724 386 386 } 387 387 388 RTDECL(int) RTFileAioCtxWait(RTFILEAIOCTX hAioCtx, size_t cMinReqs, unsigned cMillisTimeout,388 RTDECL(int) RTFileAioCtxWait(RTFILEAIOCTX hAioCtx, size_t cMinReqs, RTMSINTERVAL cMillies, 389 389 PRTFILEAIOREQ pahReqs, size_t cReqs, uint32_t *pcReqs) 390 390 { … … 417 417 int cRequestsCompleted = 0; 418 418 while ( !pCtxInt->fWokenUp 419 && (cMinReqs > 0))419 && cMinReqs > 0) 420 420 { 421 421 uint64_t StartNanoTS = 0; 422 DWORD dwTimeout = cMilli sTimeout == RT_INDEFINITE_WAIT ? INFINITE : cMillisTimeout;422 DWORD dwTimeout = cMillies == RT_INDEFINITE_WAIT ? INFINITE : cMillies; 423 423 DWORD cbTransfered; 424 424 LPOVERLAPPED pOverlapped; … … 426 426 BOOL fSucceeded; 427 427 428 if (cMilli sTimeout!= RT_INDEFINITE_WAIT)428 if (cMillies != RT_INDEFINITE_WAIT) 429 429 StartNanoTS = RTTimeNanoTS(); 430 430 … … 446 446 if (lCompletionKey == AIO_CONTEXT_WAKEUP_EVENT) 447 447 break; 448 else 448 449 /* A request completed. */ 450 PRTFILEAIOREQINTERNAL pReqInt = OVERLAPPED_2_RTFILEAIOREQINTERNAL(pOverlapped); 451 AssertPtr(pReqInt); 452 Assert(pReqInt->u32Magic == RTFILEAIOREQ_MAGIC); 453 454 /* Mark the request as finished. */ 455 RTFILEAIOREQ_SET_STATE(pReqInt, COMPLETED); 456 457 /* completion status. */ 458 DWORD cbTransfered; 459 fSucceeded = GetOverlappedResult(pReqInt->hFile, 460 &pReqInt->Overlapped, 461 &cbTransfered, 462 FALSE); 463 pReqInt->cbTransfered = cbTransfered; 464 pReqInt->Rc = VINF_SUCCESS; 465 466 pahReqs[cRequestsCompleted++] = (RTFILEAIOREQ)pReqInt; 467 468 /* Update counter. */ 469 cMinReqs--; 470 471 if (cMillies != RT_INDEFINITE_WAIT) 449 472 { 450 /* A request completed. */ 451 PRTFILEAIOREQINTERNAL pReqInt = OVERLAPPED_2_RTFILEAIOREQINTERNAL(pOverlapped); 452 AssertPtr(pReqInt); 453 Assert(pReqInt->u32Magic == RTFILEAIOREQ_MAGIC); 454 455 /* Mark the request as finished. */ 456 RTFILEAIOREQ_SET_STATE(pReqInt, COMPLETED); 457 458 /* completion status. */ 459 DWORD cbTransfered; 460 fSucceeded = GetOverlappedResult(pReqInt->hFile, 461 &pReqInt->Overlapped, 462 &cbTransfered, 463 FALSE); 464 pReqInt->cbTransfered = cbTransfered; 465 pReqInt->Rc = VINF_SUCCESS; 466 467 pahReqs[cRequestsCompleted++] = (RTFILEAIOREQ)pReqInt; 468 469 /* Update counter. */ 470 cMinReqs --; 471 472 if (cMillisTimeout != RT_INDEFINITE_WAIT) 473 { 474 /* Recalculate timeout. */ 475 uint64_t NanoTS = RTTimeNanoTS(); 476 uint64_t cMilliesElapsed = (NanoTS - StartNanoTS) / 1000000; 477 cMillisTimeout -= cMilliesElapsed; 478 } 473 /* Recalculate timeout. */ 474 uint64_t NanoTS = RTTimeNanoTS(); 475 uint64_t cMilliesElapsed = (NanoTS - StartNanoTS) / 1000000; 476 if (cMilliesElapsed < cMillies) 477 cMillies -= cMilliesElapsed; 478 else 479 cMillies = 0; 479 480 } 480 481 } -
trunk/src/VBox/Runtime/r3/win/semevent-win.cpp
r25717 r25724 197 197 198 198 #undef RTSemEventWaitNoResume 199 RTDECL(int) RTSemEventWaitNoResume(RTSEMEVENT hEventSem, unsignedcMillies)199 RTDECL(int) RTSemEventWaitNoResume(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies) 200 200 { 201 201 PCRTLOCKVALSRCPOS pSrcPos = NULL; -
trunk/src/VBox/Runtime/r3/win/semeventmulti-win.cpp
r25720 r25724 221 221 222 222 #undef RTSemEventMultiWaitNoResume 223 RTDECL(int) RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsignedcMillies)223 RTDECL(int) RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies) 224 224 { 225 225 PCRTLOCKVALSRCPOS pSrcPos = NULL; -
trunk/src/VBox/Runtime/r3/win/semmutex-win.cpp
r25721 r25724 174 174 * @param pSrcPos The source position of the caller. 175 175 */ 176 DECL_FORCE_INLINE(int) rtSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, unsignedcMillies, PCRTLOCKVALSRCPOS pSrcPos)176 DECL_FORCE_INLINE(int) rtSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies, PCRTLOCKVALSRCPOS pSrcPos) 177 177 { 178 178 /* … … 251 251 252 252 #undef RTSemMutexRequestNoResume 253 RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, unsignedcMillies)253 RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies) 254 254 { 255 255 #ifndef RTSEMMUTEX_STRICT … … 262 262 263 263 264 RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX hMutexSem, unsignedcMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)264 RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 265 265 { 266 266 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API(); -
trunk/src/VBox/Runtime/r3/win/thread-win.cpp
r13837 r25724 146 146 147 147 148 RTR3DECL(int) RTThreadSleep( unsignedcMillies)148 RTR3DECL(int) RTThreadSleep(RTMSINTERVAL cMillies) 149 149 { 150 150 LogFlow(("RTThreadSleep: cMillies=%d\n", cMillies));
Note:
See TracChangeset
for help on using the changeset viewer.