Changeset 7232 in vbox
- Timestamp:
- Mar 3, 2008 11:13:15 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 28564
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevATA.cpp
r7151 r7232 5273 5273 { 5274 5274 uint64_t u64Start = RTTimeMilliTS(); 5275 bool fAllDone; 5276 for (;;) 5277 { 5278 /* check */ 5279 fAllDone = true; 5280 for (uint32_t i = 0; i < RT_ELEMENTS(pData->aCts) && fAllDone; i++) 5281 fAllDone &= (pData->aCts[i].AsyncIOThread == NIL_RTTHREAD); 5282 5283 if ( fAllDone 5284 || RTTimeMilliTS() - u64Start >= 5000) 5285 break; 5286 5287 /* Sleep for a bit. */ 5288 RTThreadSleep(100); 5289 } 5290 AssertMsg(fAllDone, ("Some of the async I/O threads are still running!\n")); 5275 int rc2 = VINF_SUCCESS; 5276 for (unsigned i = 0; i < RT_ELEMENTS(pData->aCts); i++) 5277 { 5278 /* Wait for at most 5 seconds, and if that is elapsed for 100msec 5279 * per remaining thread. Just to be on the safe side. */ 5280 rc = RTThreadWait(pData->aCts[i].AsyncIOThread, 5281 RT_MAX(RTTimeMilliTS() - u64Start + 5000, 100), 5282 NULL); 5283 if (VBOX_FAILURE(rc) && rc != VERR_INVALID_HANDLE) 5284 rc2 = rc; 5285 } 5286 AssertMsg(VBOX_SUCCESS(rc2), ("Some of the async I/O threads are still running!\n")); 5291 5287 } 5292 5288 else … … 6078 6074 AssertRC(rc); 6079 6075 ataAsyncIOClearRequests(pCtl); 6080 rc = RTThreadCreate(&pCtl->AsyncIOThread, ataAsyncIOLoop, (void *)pCtl, 128*1024, RTTHREADTYPE_IO, 0, "ATA");6076 rc = RTThreadCreate(&pCtl->AsyncIOThread, ataAsyncIOLoop, (void *)pCtl, 128*1024, RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, "ATA"); 6081 6077 AssertRC(rc); 6082 6078 Assert(pCtl->AsyncIOThread != NIL_RTTHREAD && pCtl->AsyncIOSem != NIL_RTSEMEVENT && pCtl->SuspendIOSem != NIL_RTSEMEVENT && pCtl->AsyncIORequestMutex != NIL_RTSEMMUTEX);
Note:
See TracChangeset
for help on using the changeset viewer.