Changeset 69942 in vbox
- Timestamp:
- Dec 5, 2017 11:40:31 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
include/iprt/vfslowlevel.h (modified) (1 diff)
-
src/VBox/Runtime/common/dvm/dvmvfs.cpp (modified) (2 diffs)
-
src/VBox/Runtime/common/fs/isomaker.cpp (modified) (2 diffs)
-
src/VBox/Runtime/common/vfs/vfsbase.cpp (modified) (3 diffs)
-
src/VBox/Runtime/common/vfs/vfsmemory.cpp (modified) (2 diffs)
-
src/VBox/Storage/VDIfVfs.cpp (modified) (3 diffs)
-
src/VBox/Storage/VDVfs.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/vfslowlevel.h
r69844 r69942 883 883 * should be hidden from the caller (@c false). 884 884 * @param pfRetEvents Where to return the event mask. 885 * @note Optional. If NULL, immediately return all requested non-error 886 * events, waiting for errors works like sleep. 885 887 * @sa RTPollSetAdd, RTPoll, RTPollNoResume. 886 888 */ -
trunk/src/VBox/Runtime/common/dvm/dvmvfs.cpp
r69906 r69942 324 324 325 325 /** 326 * @interface_method_impl{RTVFSIOSTREAMOPS,pfnPollOne}327 */328 static DECLCALLBACK(int) rtDvmVfsFile_PollOne(void *pvThis, uint32_t fEvents, RTMSINTERVAL cMillies, bool fIntr,329 uint32_t *pfRetEvents)330 {331 NOREF(pvThis);332 int rc;333 if (fEvents != RTPOLL_EVT_ERROR)334 {335 *pfRetEvents = fEvents & ~RTPOLL_EVT_ERROR;336 rc = VINF_SUCCESS;337 }338 else339 rc = RTVfsUtilDummyPollOne(fEvents, cMillies, fIntr, pfRetEvents);340 return rc;341 }342 343 344 /**345 326 * @interface_method_impl{RTVFSIOSTREAMOPS,pfnTell} 346 327 */ … … 481 462 rtDvmVfsFile_Write, 482 463 rtDvmVfsFile_Flush, 483 rtDvmVfsFile_PollOne,464 NULL /*pfnPollOne*/, 484 465 rtDvmVfsFile_Tell, 485 466 NULL /*Skip*/, -
trunk/src/VBox/Runtime/common/fs/isomaker.cpp
r69941 r69942 7270 7270 7271 7271 /** 7272 * @interface_method_impl{RTVFSIOSTREAMOPS,pfnPollOne}7273 */7274 static DECLCALLBACK(int) rtFsIsoMakerOutFile_PollOne(void *pvThis, uint32_t fEvents, RTMSINTERVAL cMillies, bool fIntr,7275 uint32_t *pfRetEvents)7276 {7277 NOREF(pvThis);7278 return RTVfsUtilDummyPollOne(fEvents, cMillies, fIntr, pfRetEvents);7279 }7280 7281 7282 /**7283 7272 * @interface_method_impl{RTVFSIOSTREAMOPS,pfnTell} 7284 7273 */ … … 7415 7404 rtFsIsoMakerOutFile_Write, 7416 7405 rtFsIsoMakerOutFile_Flush, 7417 rtFsIsoMakerOutFile_PollOne,7406 NULL /*PollOne*/, 7418 7407 rtFsIsoMakerOutFile_Tell, 7419 7408 rtFsIsoMakerOutFile_Skip, -
trunk/src/VBox/Runtime/common/vfs/vfsbase.cpp
r69861 r69942 40 40 #include <iprt/param.h> 41 41 #include <iprt/path.h> 42 #include <iprt/poll.h> 42 43 #include <iprt/semaphore.h> 43 44 #include <iprt/thread.h> … … 114 115 AssertPtr((pIoStreamOps)->pfnWrite); \ 115 116 AssertPtr((pIoStreamOps)->pfnFlush); \ 116 AssertPtr ((pIoStreamOps)->pfnPollOne); \117 AssertPtrNull((pIoStreamOps)->pfnPollOne); \ 117 118 AssertPtr((pIoStreamOps)->pfnTell); \ 118 119 AssertPtrNull((pIoStreamOps)->pfnSkip); \ … … 3647 3648 AssertReturn(pThis->uMagic == RTVFSIOSTREAM_MAGIC, VERR_INVALID_HANDLE); 3648 3649 3649 RTVfsLockAcquireWrite(pThis->Base.hLock); 3650 int rc = pThis->pOps->pfnPollOne(pThis->Base.pvThis, fEvents, cMillies, fIntr, pfRetEvents); 3651 RTVfsLockReleaseWrite(pThis->Base.hLock); 3650 int rc; 3651 if (pThis->pOps->pfnPollOne) 3652 { 3653 RTVfsLockAcquireWrite(pThis->Base.hLock); 3654 rc = pThis->pOps->pfnPollOne(pThis->Base.pvThis, fEvents, cMillies, fIntr, pfRetEvents); 3655 RTVfsLockReleaseWrite(pThis->Base.hLock); 3656 } 3657 /* 3658 * Default implementation. Polling for non-error events returns 3659 * immediately, waiting for errors will work like sleep. 3660 */ 3661 else if (fEvents != RTPOLL_EVT_ERROR) 3662 { 3663 *pfRetEvents = fEvents & ~RTPOLL_EVT_ERROR; 3664 rc = VINF_SUCCESS; 3665 } 3666 else if (fIntr) 3667 rc = RTThreadSleep(cMillies); 3668 else 3669 { 3670 uint64_t uMsStart = RTTimeMilliTS(); 3671 do 3672 rc = RTThreadSleep(cMillies); 3673 while ( rc == VERR_INTERRUPTED 3674 && !fIntr 3675 && RTTimeMilliTS() - uMsStart < cMillies); 3676 if (rc == VERR_INTERRUPTED) 3677 rc = VERR_TIMEOUT; 3678 } 3652 3679 return rc; 3653 3680 } -
trunk/src/VBox/Runtime/common/vfs/vfsmemory.cpp
r69111 r69942 551 551 552 552 /** 553 * @interface_method_impl{RTVFSIOSTREAMOPS,pfnPollOne}554 */555 static DECLCALLBACK(int) rtVfsMemFile_PollOne(void *pvThis, uint32_t fEvents, RTMSINTERVAL cMillies, bool fIntr,556 uint32_t *pfRetEvents)557 {558 NOREF(pvThis);559 int rc;560 if (fEvents != RTPOLL_EVT_ERROR)561 {562 *pfRetEvents = fEvents & ~RTPOLL_EVT_ERROR;563 rc = VINF_SUCCESS;564 }565 else566 rc = RTVfsUtilDummyPollOne(fEvents, cMillies, fIntr, pfRetEvents);567 return rc;568 }569 570 571 /**572 553 * @interface_method_impl{RTVFSIOSTREAMOPS,pfnTell} 573 554 */ … … 718 699 rtVfsMemFile_Write, 719 700 rtVfsMemFile_Flush, 720 rtVfsMemFile_PollOne,701 NULL /*PollOne*/, 721 702 rtVfsMemFile_Tell, 722 703 NULL /*Skip*/, -
trunk/src/VBox/Storage/VDIfVfs.cpp
r69500 r69942 161 161 162 162 /** 163 * @interface_method_impl{RTVFSIOSTREAMOPS,pfnPollOne}164 */165 static DECLCALLBACK(int) vdIfVfsIos_PollOne(void *pvThis, uint32_t fEvents, RTMSINTERVAL cMillies, bool fIntr,166 uint32_t *pfRetEvents)167 {168 NOREF(pvThis);169 int rc;170 if (fEvents != RTPOLL_EVT_ERROR)171 {172 *pfRetEvents = fEvents & ~RTPOLL_EVT_ERROR;173 rc = VINF_SUCCESS;174 }175 else176 rc = RTVfsUtilDummyPollOne(fEvents, cMillies, fIntr, pfRetEvents);177 return rc;178 }179 180 181 /**182 163 * @interface_method_impl{RTVFSIOSTREAMOPS,pfnTell} 183 164 */ … … 208 189 vdIfVfsIos_Write, 209 190 vdIfVfsIos_Flush, 210 vdIfVfsIos_PollOne,191 NULL /*PollOne*/, 211 192 vdIfVfsIos_Tell, 212 193 NULL /*Skip*/, … … 366 347 vdIfVfsIos_Write, 367 348 vdIfVfsIos_Flush, 368 vdIfVfsIos_PollOne,349 NULL /*PollOne*/, 369 350 vdIfVfsIos_Tell, 370 351 NULL /*Skip*/, -
trunk/src/VBox/Storage/VDVfs.cpp
r69602 r69942 386 386 387 387 /** 388 * @interface_method_impl{RTVFSIOSTREAMOPS,pfnPollOne}389 */390 static DECLCALLBACK(int) vdVfsFile_PollOne(void *pvThis, uint32_t fEvents, RTMSINTERVAL cMillies, bool fIntr,391 uint32_t *pfRetEvents)392 {393 NOREF(pvThis);394 int rc;395 if (fEvents != RTPOLL_EVT_ERROR)396 {397 *pfRetEvents = fEvents & ~RTPOLL_EVT_ERROR;398 rc = VINF_SUCCESS;399 }400 else401 rc = RTVfsUtilDummyPollOne(fEvents, cMillies, fIntr, pfRetEvents);402 return rc;403 }404 405 406 /**407 388 * @interface_method_impl{RTVFSIOSTREAMOPS,pfnTell} 408 389 */ … … 541 522 vdVfsFile_Write, 542 523 vdVfsFile_Flush, 543 vdVfsFile_PollOne,524 NULL /*PollOne*/, 544 525 vdVfsFile_Tell, 545 526 NULL /*Skip*/,
Note:
See TracChangeset
for help on using the changeset viewer.

