VirtualBox

Changeset 25724 in vbox


Ignore:
Timestamp:
Jan 11, 2010 2:45:34 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56467
Message:

iprt: Use RTMSINTERVAL for timeouts. Fixed missing timeout underflow checks in two RTFileAioCtxWait implementations.

Location:
trunk
Files:
51 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/file.h

    r25645 r25724  
    11951195 * @param   cMinReqs        The minimum number of requests which have to
    11961196 *                          complete before this function returns.
    1197  * @param   cMillisTimeout  The number of milliseconds to wait before returning
    1198  *                          VERR_TIMEOUT. Use RT_INDEFINITE_WAIT to wait
     1197 * @param   cMillies        The number of milliseconds to wait before returning
     1198 *                          VERR_TIMEOUT.  Use RT_INDEFINITE_WAIT to wait
    11991199 *                          forever.
    12001200 * @param   pahReqs         Pointer to an array where the handles of the
     
    12121212 *          RT_ELEMENTS and similar macros.
    12131213 */
    1214 RTDECL(int) RTFileAioCtxWait(RTFILEAIOCTX hAioCtx, size_t cMinReqs, unsigned cMillisTimeout,
     1214RTDECL(int) RTFileAioCtxWait(RTFILEAIOCTX hAioCtx, size_t cMinReqs, RTMSINTERVAL cMillies,
    12151215                             PRTFILEAIOREQ pahReqs, size_t cReqs, uint32_t *pcReqs);
    12161216
  • trunk/include/iprt/req.h

    r24468 r25724  
    186186 *                          Use RT_INDEFINITE_WAIT to only wait till one is added.
    187187 */
    188 RTDECL(int) RTReqProcess(PRTREQQUEUE pQueue, unsigned cMillies);
     188RTDECL(int) RTReqProcess(PRTREQQUEUE pQueue, RTMSINTERVAL cMillies);
    189189
    190190
     
    213213 * @remarks See remarks on RTReqCallV.
    214214 */
    215 RTDECL(int) RTReqCall(PRTREQQUEUE pQueue, PRTREQ *ppReq, unsigned cMillies, PFNRT pfnFunction, unsigned cArgs, ...);
     215RTDECL(int) RTReqCall(PRTREQQUEUE pQueue, PRTREQ *ppReq, RTMSINTERVAL cMillies, PFNRT pfnFunction, unsigned cArgs, ...);
    216216
    217217
     
    240240 * @remarks See remarks on RTReqCallV.
    241241 */
    242 RTDECL(int) RTReqCallVoid(PRTREQQUEUE pQueue, PRTREQ *ppReq, unsigned cMillies, PFNRT pfnFunction, unsigned cArgs, ...);
     242RTDECL(int) RTReqCallVoid(PRTREQQUEUE pQueue, PRTREQ *ppReq, RTMSINTERVAL cMillies, PFNRT pfnFunction, unsigned cArgs, ...);
    243243
    244244
     
    269269 * @remarks See remarks on RTReqCallV.
    270270 */
    271 RTDECL(int) RTReqCallEx(PRTREQQUEUE pQueue, PRTREQ *ppReq, unsigned cMillies, unsigned fFlags, PFNRT pfnFunction, unsigned cArgs, ...);
     271RTDECL(int) RTReqCallEx(PRTREQQUEUE pQueue, PRTREQ *ppReq, RTMSINTERVAL cMillies, unsigned fFlags, PFNRT pfnFunction, unsigned cArgs, ...);
    272272
    273273
     
    305305 *                Use (void *)NULL or (uintptr_t)0 instead of NULL.
    306306 */
    307 RTDECL(int) RTReqCallV(PRTREQQUEUE pQueue, PRTREQ *ppReq, unsigned cMillies, unsigned fFlags, PFNRT pfnFunction, unsigned cArgs, va_list Args);
     307RTDECL(int) RTReqCallV(PRTREQQUEUE pQueue, PRTREQ *ppReq, RTMSINTERVAL cMillies, unsigned fFlags, PFNRT pfnFunction, unsigned cArgs, va_list Args);
    308308
    309309
     
    352352 *                          wait till it's completed.
    353353 */
    354 RTDECL(int) RTReqQueue(PRTREQ pReq, unsigned cMillies);
     354RTDECL(int) RTReqQueue(PRTREQ pReq, RTMSINTERVAL cMillies);
    355355
    356356
     
    366366 *                          Use RT_INDEFINITE_WAIT to only wait till it's completed.
    367367 */
    368 RTDECL(int) RTReqWait(PRTREQ pReq, unsigned cMillies);
     368RTDECL(int) RTReqWait(PRTREQ pReq, RTMSINTERVAL cMillies);
    369369
    370370/**
  • trunk/include/iprt/semaphore.h

    r25723 r25724  
    123123 * @param   cMillies            Number of milliseconds to wait.
    124124 */
    125 RTDECL(int)  RTSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies);
     125RTDECL(int)  RTSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies);
    126126
    127127/**
     
    134134 * @param   cMillies            Number of milliseconds to wait.
    135135 */
    136 RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT hEventSem, unsigned cMillies);
     136RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies);
    137137
    138138/**
     
    251251 * @param   cMillies            Number of milliseconds to wait.
    252252 */
    253 RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies);
     253RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies);
    254254
    255255
     
    263263 * @param   cMillies            Number of milliseconds to wait.
    264264 */
    265 RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies);
     265RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies);
    266266
    267267/**
     
    389389 * @param   cMillies            The number of milliseconds to wait.
    390390 */
    391 RTDECL(int)  RTSemMutexRequest(RTSEMMUTEX hMutexSem, unsigned cMillies);
     391RTDECL(int)  RTSemMutexRequest(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies);
    392392
    393393/**
     
    404404 * @param   cMillies            The number of milliseconds to wait.
    405405 */
    406 RTDECL(int)  RTSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, unsigned cMillies);
     406RTDECL(int)  RTSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies);
    407407
    408408/**
     
    421421 *                              from.  Optional.
    422422 */
    423 RTDECL(int)  RTSemMutexRequestDebug(RTSEMMUTEX hMutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL);
     423RTDECL(int)  RTSemMutexRequestDebug(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL);
    424424
    425425/**
     
    437437 *                              from.  Optional.
    438438 */
    439 RTDECL(int)  RTSemMutexRequestNoResumeDebug(RTSEMMUTEX hMutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL);
     439RTDECL(int)  RTSemMutexRequestNoResumeDebug(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL);
    440440
    441441/**
     
    976976 * @param   cMillies    Number of milliseconds to wait.
    977977 */
    978 RTDECL(int) RTSemPingWait(PRTPINGPONG pPP, unsigned cMillies);
     978RTDECL(int) RTSemPingWait(PRTPINGPONG pPP, RTMSINTERVAL cMillies);
    979979
    980980/**
     
    986986 * @param   cMillies    Number of milliseconds to wait.
    987987 */
    988 RTDECL(int) RTSemPongWait(PRTPINGPONG pPP, unsigned cMillies);
     988RTDECL(int) RTSemPongWait(PRTPINGPONG pPP, RTMSINTERVAL cMillies);
    989989
    990990
  • trunk/include/iprt/tcp.h

    r23625 r25724  
    198198 *                      Use RT_INDEFINITE_WAIT to wait for ever.
    199199 */
    200 RTR3DECL(int)  RTTcpSelectOne(RTSOCKET Sock, unsigned cMillies);
     200RTR3DECL(int)  RTTcpSelectOne(RTSOCKET Sock, RTMSINTERVAL cMillies);
    201201
    202202
  • trunk/include/iprt/thread.h

    r25638 r25724  
    200200 * @remark  See RTThreadNanoSleep() for sleeping for smaller periods of time.
    201201 */
    202 RTDECL(int) RTThreadSleep(unsigned cMillies);
     202RTDECL(int) RTThreadSleep(RTMSINTERVAL cMillies);
    203203
    204204/**
     
    334334 * @param       prc             Where to store the return code of the thread. Optional.
    335335 */
    336 RTDECL(int) RTThreadWait(RTTHREAD Thread, unsigned cMillies, int *prc);
     336RTDECL(int) RTThreadWait(RTTHREAD Thread, RTMSINTERVAL cMillies, int *prc);
    337337
    338338/**
     
    345345 * @param       prc             Where to store the return code of the thread. Optional.
    346346 */
    347 RTDECL(int) RTThreadWaitNoResume(RTTHREAD Thread, unsigned cMillies, int *prc);
     347RTDECL(int) RTThreadWaitNoResume(RTTHREAD Thread, RTMSINTERVAL cMillies, int *prc);
    348348
    349349/**
     
    406406 *                              an indefinite wait.
    407407 */
    408 RTDECL(int) RTThreadUserWait(RTTHREAD Thread, unsigned cMillies);
     408RTDECL(int) RTThreadUserWait(RTTHREAD Thread, RTMSINTERVAL cMillies);
    409409
    410410/**
     
    416416 *                              an indefinite wait.
    417417 */
    418 RTDECL(int) RTThreadUserWaitNoResume(RTTHREAD Thread, unsigned cMillies);
     418RTDECL(int) RTThreadUserWaitNoResume(RTTHREAD Thread, RTMSINTERVAL cMillies);
    419419
    420420/**
  • trunk/src/VBox/Runtime/common/misc/req.cpp

    r24468 r25724  
    109109 *                          Use RT_INDEFINITE_WAIT to only wait till one is added.
    110110 */
    111 RTDECL(int) RTReqProcess(PRTREQQUEUE pQueue, unsigned cMillies)
     111RTDECL(int) RTReqProcess(PRTREQQUEUE pQueue, RTMSINTERVAL cMillies)
    112112{
    113113    LogFlow(("RTReqProcess %x\n", pQueue));
     
    211211 * @remarks See remarks on RTReqCallV.
    212212 */
    213 RTDECL(int) RTReqCall(PRTREQQUEUE pQueue, PRTREQ *ppReq, unsigned cMillies, PFNRT pfnFunction, unsigned cArgs, ...)
     213RTDECL(int) RTReqCall(PRTREQQUEUE pQueue, PRTREQ *ppReq, RTMSINTERVAL cMillies, PFNRT pfnFunction, unsigned cArgs, ...)
    214214{
    215215    va_list va;
     
    246246 * @remarks See remarks on RTReqCallV.
    247247 */
    248 RTDECL(int) RTReqCallVoid(PRTREQQUEUE pQueue, PRTREQ *ppReq, unsigned cMillies, PFNRT pfnFunction, unsigned cArgs, ...)
     248RTDECL(int) RTReqCallVoid(PRTREQQUEUE pQueue, PRTREQ *ppReq, RTMSINTERVAL cMillies, PFNRT pfnFunction, unsigned cArgs, ...)
    249249{
    250250    va_list va;
     
    283283 * @remarks See remarks on RTReqCallV.
    284284 */
    285 RTDECL(int) RTReqCallEx(PRTREQQUEUE pQueue, PRTREQ *ppReq, unsigned cMillies, unsigned fFlags, PFNRT pfnFunction, unsigned cArgs, ...)
     285RTDECL(int) RTReqCallEx(PRTREQQUEUE pQueue, PRTREQ *ppReq, RTMSINTERVAL cMillies, unsigned fFlags, PFNRT pfnFunction, unsigned cArgs, ...)
    286286{
    287287    va_list va;
     
    327327 *                Use (void *)NULL or (uintptr_t)0 instead of NULL.
    328328 */
    329 RTDECL(int) RTReqCallV(PRTREQQUEUE pQueue, PRTREQ *ppReq, unsigned cMillies, unsigned fFlags, PFNRT pfnFunction, unsigned cArgs, va_list Args)
     329RTDECL(int) RTReqCallV(PRTREQQUEUE pQueue, PRTREQ *ppReq, RTMSINTERVAL cMillies, unsigned fFlags, PFNRT pfnFunction, unsigned cArgs, va_list Args)
    330330{
    331331    LogFlow(("RTReqCallV: cMillies=%d fFlags=%#x pfnFunction=%p cArgs=%d\n", cMillies, fFlags, pfnFunction, cArgs));
     
    656656 *                          wait till it's completed.
    657657 */
    658 RTDECL(int) RTReqQueue(PRTREQ pReq, unsigned cMillies)
     658RTDECL(int) RTReqQueue(PRTREQ pReq, RTMSINTERVAL cMillies)
    659659{
    660660    LogFlow(("RTReqQueue: pReq=%p cMillies=%d\n", pReq, cMillies));
     
    724724 *                          Use RT_INDEFINITE_WAIT to only wait till it's completed.
    725725 */
    726 RTDECL(int) RTReqWait(PRTREQ pReq, unsigned cMillies)
     726RTDECL(int) RTReqWait(PRTREQ pReq, RTMSINTERVAL cMillies)
    727727{
    728728    LogFlow(("RTReqWait: pReq=%p cMillies=%d\n", pReq, cMillies));
  • trunk/src/VBox/Runtime/common/misc/semspingpong.cpp

    r21337 r25724  
    197197 * @param   cMillies    Number of milliseconds to wait.
    198198 */
    199 RTDECL(int) RTSemPingWait(PRTPINGPONG pPP, unsigned cMillies)
     199RTDECL(int) RTSemPingWait(PRTPINGPONG pPP, RTMSINTERVAL cMillies)
    200200{
    201201    /*
     
    230230 * @param   cMillies    Number of milliseconds to wait.
    231231 */
    232 RTDECL(int) RTSemPongWait(PRTPINGPONG pPP, unsigned cMillies)
     232RTDECL(int) RTSemPongWait(PRTPINGPONG pPP, RTMSINTERVAL cMillies)
    233233{
    234234    /*
  • trunk/src/VBox/Runtime/common/misc/thread.cpp

    r25690 r25724  
    994994 *                              an indefinite wait.
    995995 */
    996 RTDECL(int) RTThreadUserWait(RTTHREAD Thread, unsigned cMillies)
     996RTDECL(int) RTThreadUserWait(RTTHREAD Thread, RTMSINTERVAL cMillies)
    997997{
    998998    int             rc;
     
    10181018 *                              an indefinite wait.
    10191019 */
    1020 RTDECL(int) RTThreadUserWaitNoResume(RTTHREAD Thread, unsigned cMillies)
     1020RTDECL(int) RTThreadUserWaitNoResume(RTTHREAD Thread, RTMSINTERVAL cMillies)
    10211021{
    10221022    int             rc;
     
    10661066 * @param       fAutoResume     Whether or not to resume the wait on VERR_INTERRUPTED.
    10671067 */
    1068 static int rtThreadWait(RTTHREAD Thread, unsigned cMillies, int *prc, bool fAutoResume)
     1068static int rtThreadWait(RTTHREAD Thread, RTMSINTERVAL cMillies, int *prc, bool fAutoResume)
    10691069{
    10701070    int rc = VERR_INVALID_HANDLE;
     
    11161116 * @param       prc             Where to store the return code of the thread. Optional.
    11171117 */
    1118 RTDECL(int) RTThreadWait(RTTHREAD Thread, unsigned cMillies, int *prc)
     1118RTDECL(int) RTThreadWait(RTTHREAD Thread, RTMSINTERVAL cMillies, int *prc)
    11191119{
    11201120    int rc = rtThreadWait(Thread, cMillies, prc, true);
     
    11341134 * @param       prc             Where to store the return code of the thread. Optional.
    11351135 */
    1136 RTDECL(int) RTThreadWaitNoResume(RTTHREAD Thread, unsigned cMillies, int *prc)
     1136RTDECL(int) RTThreadWaitNoResume(RTTHREAD Thread, RTMSINTERVAL cMillies, int *prc)
    11371137{
    11381138    return rtThreadWait(Thread, cMillies, prc, false);
  • trunk/src/VBox/Runtime/generic/RTSemEventMultiWait-generic.cpp

    r25381 r25724  
    4343
    4444#undef RTSemEventMultiWait              /* undo debug mapping */
    45 RTDECL(int) RTSemEventMultiWait(RTSEMEVENTMULTI EventSem, unsigned cMillies)
     45RTDECL(int) RTSemEventMultiWait(RTSEMEVENTMULTI EventSem, RTMSINTERVAL cMillies)
    4646{
    4747    int rc;
     
    6262                if (u64Elapsed >= cMillies)
    6363                    return VERR_TIMEOUT;
    64                 rc = RTSemEventMultiWaitNoResume(EventSem, cMillies - (unsigned)u64Elapsed);
     64                rc = RTSemEventMultiWaitNoResume(EventSem, cMillies - (RTMSINTERVAL)u64Elapsed);
    6565            } while (rc == VERR_INTERRUPTED);
    6666        }
  • trunk/src/VBox/Runtime/generic/RTSemEventWait-generic.cpp

    r25381 r25724  
    4343
    4444#undef RTSemEventWait                   /* undo debug mapping */
    45 RTDECL(int) RTSemEventWait(RTSEMEVENT EventSem, unsigned cMillies)
     45RTDECL(int) RTSemEventWait(RTSEMEVENT EventSem, RTMSINTERVAL cMillies)
    4646{
    4747    int rc;
     
    6262                if (u64Elapsed >= cMillies)
    6363                    return VERR_TIMEOUT;
    64                 rc = RTSemEventWaitNoResume(EventSem, cMillies - (unsigned)u64Elapsed);
     64                rc = RTSemEventWaitNoResume(EventSem, cMillies - (RTMSINTERVAL)u64Elapsed);
    6565            } while (rc == VERR_INTERRUPTED);
    6666        }
  • trunk/src/VBox/Runtime/generic/RTSemMutexRequest-generic.cpp

    r25381 r25724  
    4343
    4444#undef RTSemMutexRequest                /* undo debug mapping */
    45 RTDECL(int) RTSemMutexRequest(RTSEMMUTEX Mutex, unsigned cMillies)
     45RTDECL(int) RTSemMutexRequest(RTSEMMUTEX Mutex, RTMSINTERVAL cMillies)
    4646{
    4747    int rc;
     
    6262                if (u64Elapsed >= cMillies)
    6363                    return VERR_TIMEOUT;
    64                 rc = RTSemMutexRequestNoResume(Mutex, cMillies - (unsigned)u64Elapsed);
     64                rc = RTSemMutexRequestNoResume(Mutex, cMillies - (RTMSINTERVAL)u64Elapsed);
    6565            } while (rc == VERR_INTERRUPTED);
    6666        }
  • trunk/src/VBox/Runtime/generic/RTSemMutexRequestDebug-generic.cpp

    r25381 r25724  
    4343
    4444
    45 RTDECL(int) RTSemMutexRequestDebug(RTSEMMUTEX Mutex, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
     45RTDECL(int) RTSemMutexRequestDebug(RTSEMMUTEX Mutex, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
    4646{
    4747    int rc;
     
    6262                if (u64Elapsed >= cMillies)
    6363                    return VERR_TIMEOUT;
    64                 rc = RTSemMutexRequestNoResumeDebug(Mutex, cMillies - (unsigned)u64Elapsed, uId, RT_SRC_POS_ARGS);
     64                rc = RTSemMutexRequestNoResumeDebug(Mutex, cMillies - (RTMSINTERVAL)u64Elapsed, uId, RT_SRC_POS_ARGS);
    6565            } while (rc == VERR_INTERRUPTED);
    6666        }
  • trunk/src/VBox/Runtime/generic/semrw-generic.cpp

    r25723 r25724  
    263263    AssertReturn(pThis->u32Magic == RTSEMRW_MAGIC, VERR_INVALID_HANDLE);
    264264
    265     unsigned        cMilliesInitial = cMillies;
     265    RTMSINTERVAL    cMilliesInitial = cMillies;
    266266    uint64_t        tsStart = 0;
    267267    if (cMillies != RT_INDEFINITE_WAIT && cMillies != 0)
     
    353353                tsDelta /= 1000000;
    354354                if ((uint64_t)tsDelta < cMilliesInitial)
    355                     cMilliesInitial = (unsigned)tsDelta;
     355                    cMilliesInitial = (RTMSINTERVAL)tsDelta;
    356356                else
    357357                    cMilliesInitial = 1;
     
    555555     * Validate handle.
    556556     */
    557     struct RTSEMRWINTERNAL *pThis = hRWSem;
     557    struct RTSEMRWINTERNAL *pThis   = hRWSem;
    558558    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    559559    AssertReturn(pThis->u32Magic == RTSEMRW_MAGIC, VERR_INVALID_HANDLE);
    560560
    561     unsigned    cMilliesInitial = cMillies;
    562     uint64_t    tsStart = 0;
     561    RTMSINTERVAL    cMilliesInitial = cMillies;
     562    uint64_t        tsStart        = 0;
    563563    if (cMillies != RT_INDEFINITE_WAIT && cMillies != 0)
    564564        tsStart = RTTimeNanoTS();
     
    643643                tsDelta /= 1000000;
    644644                if ((uint64_t)tsDelta < cMilliesInitial)
    645                     cMilliesInitial = (unsigned)tsDelta;
     645                    cMilliesInitial = (RTMSINTERVAL)tsDelta;
    646646                else
    647647                    cMilliesInitial = 1;
  • trunk/src/VBox/Runtime/r0drv/darwin/semaphore-r0drv-darwin.cpp

    r25722 r25724  
    215215
    216216
    217 static int rtSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies, wait_interrupt_t fInterruptible)
     217static int rtSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies, wait_interrupt_t fInterruptible)
    218218{
    219219    PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)hEventSem;
     
    305305
    306306
    307 RTDECL(int)  RTSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies)
     307RTDECL(int)  RTSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    308308{
    309309    return rtSemEventWait(hEventSem, cMillies, THREAD_UNINT);
     
    311311
    312312
    313 RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT hEventSem, unsigned cMillies)
     313RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    314314{
    315315    return rtSemEventWait(hEventSem, cMillies, THREAD_ABORTSAFE);
     
    428428
    429429
    430 static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies, wait_interrupt_t fInterruptible)
     430static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies, wait_interrupt_t fInterruptible)
    431431{
    432432    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
     
    514514
    515515
    516 RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
     516RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    517517{
    518518    return rtSemEventMultiWait(hEventMultiSem, cMillies, THREAD_UNINT);
     
    520520
    521521
    522 RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
     522RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    523523{
    524524    return rtSemEventMultiWait(hEventMultiSem, cMillies, THREAD_ABORTSAFE);
     
    577577
    578578
    579 RTDECL(int)  RTSemMutexRequest(RTSEMMUTEX hMutexSem, unsigned cMillies)
     579RTDECL(int)  RTSemMutexRequest(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies)
    580580{
    581581    /*
  • trunk/src/VBox/Runtime/r0drv/darwin/thread-r0drv-darwin.cpp

    r22052 r25724  
    4848
    4949
    50 RTDECL(int) RTThreadSleep(unsigned cMillies)
     50RTDECL(int) RTThreadSleep(RTMSINTERVAL cMillies)
    5151{
    5252    RT_ASSERT_PREEMPTIBLE();
  • trunk/src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c

    r25717 r25724  
    162162
    163163
    164 static int rtSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies, bool fInterruptible)
     164static int rtSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies, bool fInterruptible)
    165165{
    166166    int rc;
     
    283283
    284284
    285 RTDECL(int)  RTSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies)
     285RTDECL(int)  RTSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    286286{
    287287    return rtSemEventWait(hEventSem, cMillies, false /* not interruptible */);
     
    289289
    290290
    291 RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT hEventSem, unsigned cMillies)
     291RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    292292{
    293293    return rtSemEventWait(hEventSem, cMillies, true /* interruptible */);
  • trunk/src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c

    r25720 r25724  
    177177
    178178
    179 static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies, bool fInterruptible)
     179static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies, bool fInterruptible)
    180180{
    181181    int rc;
     
    293293
    294294
    295 RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
     295RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    296296{
    297297    return rtSemEventMultiWait(hEventMultiSem, cMillies, false /* not interruptible */);
     
    299299
    300300
    301 RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
     301RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    302302{
    303303    return rtSemEventMultiWait(hEventMultiSem, cMillies, true /* interruptible */);
  • trunk/src/VBox/Runtime/r0drv/freebsd/thread-r0drv-freebsd.c

    r22151 r25724  
    4949
    5050
    51 RTDECL(int) RTThreadSleep(unsigned cMillies)
     51RTDECL(int) RTThreadSleep(RTMSINTERVAL cMillies)
    5252{
    5353    int rc;
  • trunk/src/VBox/Runtime/r0drv/linux/semevent-r0drv-linux.c

    r25717 r25724  
    138138 * @param   fInterruptible      Whether it's an interruptible wait or not.
    139139 */
    140 static int rtSemEventWait(PRTSEMEVENTINTERNAL pThis, unsigned cMillies, bool fInterruptible)
     140static int rtSemEventWait(PRTSEMEVENTINTERNAL pThis, RTMSINTERVAL cMillies, bool fInterruptible)
    141141{
    142142    /*
     
    193193
    194194
    195 RTDECL(int) RTSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies)
     195RTDECL(int) RTSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    196196{
    197197    PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)hEventSem;
     
    206206
    207207
    208 RTDECL(int) RTSemEventWaitNoResume(RTSEMEVENT hEventSem, unsigned cMillies)
     208RTDECL(int) RTSemEventWaitNoResume(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    209209{
    210210    PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)hEventSem;
  • trunk/src/VBox/Runtime/r0drv/linux/semeventmulti-r0drv-linux.c

    r25720 r25724  
    161161 * @param   fInterruptible      Whether it's an interruptible wait or not.
    162162 */
    163 static int rtSemEventMultiWait(PRTSEMEVENTMULTIINTERNAL pThis, unsigned cMillies, bool fInterruptible)
     163static int rtSemEventMultiWait(PRTSEMEVENTMULTIINTERNAL pThis, RTMSINTERVAL cMillies, bool fInterruptible)
    164164{
    165165    /*
     
    216216
    217217
    218 RTDECL(int) RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
     218RTDECL(int) RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    219219{
    220220    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
     
    231231
    232232
    233 RTDECL(int) RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
     233RTDECL(int) RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    234234{
    235235    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
  • trunk/src/VBox/Runtime/r0drv/linux/semmutex-r0drv-linux.c

    r25721 r25724  
    120120
    121121#undef RTSemMutexRequest
    122 RTDECL(int)  RTSemMutexRequest(RTSEMMUTEX hMutexSem, unsigned cMillies)
     122RTDECL(int)  RTSemMutexRequest(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies)
    123123{
    124124    int                 rc    = VINF_SUCCESS;
  • trunk/src/VBox/Runtime/r0drv/linux/thread-r0drv-linux.c

    r22150 r25724  
    5959
    6060
    61 RTDECL(int) RTThreadSleep(unsigned cMillies)
     61RTDECL(int) RTThreadSleep(RTMSINTERVAL cMillies)
    6262{
    6363    long cJiffies = msecs_to_jiffies(cMillies);
  • trunk/src/VBox/Runtime/r0drv/nt/semevent-r0drv-nt.cpp

    r25717 r25724  
    120120
    121121
    122 static int rtSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies, bool fInterruptible)
     122static int rtSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies, bool fInterruptible)
    123123{
    124124    /*
     
    163163
    164164
    165 RTDECL(int)  RTSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies)
     165RTDECL(int)  RTSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    166166{
    167167    return rtSemEventWait(hEventSem, cMillies, false /* fInterruptible */);
     
    169169
    170170
    171 RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT hEventSem, unsigned cMillies)
     171RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    172172{
    173173    return rtSemEventWait(hEventSem, cMillies, true /* fInterruptible */);
  • trunk/src/VBox/Runtime/r0drv/nt/semeventmulti-r0drv-nt.cpp

    r25722 r25724  
    142142
    143143
    144 static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies, bool fInterruptible)
     144static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies, bool fInterruptible)
    145145{
    146146    /*
     
    187187
    188188
    189 RTDECL(int) RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
     189RTDECL(int) RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    190190{
    191191    return rtSemEventMultiWait(hEventMultiSem, cMillies, false /* fInterruptible */);
     
    193193
    194194
    195 RTDECL(int) RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
     195RTDECL(int) RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    196196{
    197197    return rtSemEventMultiWait(hEventMultiSem, cMillies, true /* fInterruptible */);
  • trunk/src/VBox/Runtime/r0drv/nt/semmutex-r0drv-nt.cpp

    r25721 r25724  
    123123 *                              (RTSemMutexRequest).
    124124 */
    125 static int rtSemMutexRequest(RTSEMMUTEX hMutexSem, unsigned cMillies, BOOLEAN fInterruptible)
     125static int rtSemMutexRequest(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies, BOOLEAN fInterruptible)
    126126{
    127127    /*
     
    174174
    175175#undef RTSemMutexRequest
    176 RTDECL(int) RTSemMutexRequest(RTSEMMUTEX hMutexSem, unsigned cMillies)
     176RTDECL(int) RTSemMutexRequest(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies)
    177177{
    178178    return rtSemMutexRequest(hMutexSem, cMillies, FALSE /*fInterruptible*/);
     
    180180
    181181
    182 RTDECL(int) RTSemMutexRequestDebug(RTSEMMUTEX hMutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
     182RTDECL(int) RTSemMutexRequestDebug(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
    183183{
    184184    return RTSemMutexRequest(hMutexSem, cMillies);
     
    187187
    188188#undef RTSemMutexRequestNoResume
    189 RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, unsigned cMillies)
     189RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies)
    190190{
    191191    return rtSemMutexRequest(hMutexSem, cMillies, TRUE /*fInterruptible*/);
     
    193193
    194194
    195 RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX hMutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
     195RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
    196196{
    197197    return RTSemMutexRequestNoResume(hMutexSem, cMillies);
  • trunk/src/VBox/Runtime/r0drv/nt/thread-r0drv-nt.cpp

    r24034 r25724  
    5454
    5555
    56 RTDECL(int)   RTThreadSleep(unsigned cMillies)
     56RTDECL(int)   RTThreadSleep(RTMSINTERVAL cMillies)
    5757{
    5858    LARGE_INTEGER Interval;
  • trunk/src/VBox/Runtime/r0drv/os2/semevent-r0drv-os2.cpp

    r25717 r25724  
    154154
    155155
    156 static int rtSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies, bool fInterruptible)
     156static int rtSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies, bool fInterruptible)
    157157{
    158158    PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)hEventSem;
     
    221221
    222222
    223 RTDECL(int)  RTSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies)
     223RTDECL(int)  RTSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    224224{
    225225    return rtSemEventWait(hEventSem, cMillies, false /* not interruptible */);
     
    227227
    228228
    229 RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT hEventSem, unsigned cMillies)
     229RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    230230{
    231231    return rtSemEventWait(hEventSem, cMillies, true /* interruptible */);
  • trunk/src/VBox/Runtime/r0drv/os2/semeventmulti-r0drv-os2.cpp

    r25720 r25724  
    164164
    165165
    166 static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies, bool fInterruptible)
     166static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies, bool fInterruptible)
    167167{
    168168    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
     
    230230
    231231
    232 RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
     232RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    233233{
    234234    return rtSemEventMultiWait(hEventMultiSem, cMillies, false /* not interruptible */);
     
    236236
    237237
    238 RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
     238RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    239239{
    240240    return rtSemEventMultiWait(hEventMultiSem, cMillies, true /* interruptible */);
  • trunk/src/VBox/Runtime/r0drv/os2/thread-r0drv-os2.cpp

    r24287 r25724  
    5959
    6060
    61 RTDECL(int) RTThreadSleep(unsigned cMillies)
     61RTDECL(int) RTThreadSleep(RTMSINTERVAL cMillies)
    6262{
    6363    int rc = KernBlock((ULONG)RTThreadSleep,
  • trunk/src/VBox/Runtime/r0drv/solaris/semevent-r0drv-solaris.c

    r25717 r25724  
    183183
    184184
    185 static int rtSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies, bool fInterruptible)
     185static int rtSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies, bool fInterruptible)
    186186{
    187187    int rc;
     
    270270
    271271
    272 RTDECL(int)  RTSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies)
     272RTDECL(int)  RTSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    273273{
    274274    return rtSemEventWait(hEventSem, cMillies, false /* not interruptible */);
     
    276276
    277277
    278 RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT hEventSem, unsigned cMillies)
     278RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    279279{
    280280    return rtSemEventWait(hEventSem, cMillies, true /* interruptible */);
  • trunk/src/VBox/Runtime/r0drv/solaris/semeventmulti-r0drv-solaris.c

    r25720 r25724  
    217217
    218218
    219 static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies, bool fInterruptible)
     219static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies, bool fInterruptible)
    220220{
    221221    int rc;
     
    301301
    302302
    303 RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
     303RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    304304{
    305305    return rtSemEventMultiWait(hEventMultiSem, cMillies, false /* not interruptible */);
     
    307307
    308308
    309 RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
     309RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    310310{
    311311    return rtSemEventMultiWait(hEventMultiSem, cMillies, true /* interruptible */);
  • trunk/src/VBox/Runtime/r0drv/solaris/vbi/thread-r0drv-solaris.c

    r25183 r25724  
    5050
    5151
    52 RTDECL(int) RTThreadSleep(unsigned cMillies)
     52RTDECL(int) RTThreadSleep(RTMSINTERVAL cMillies)
    5353{
    5454    clock_t cTicks;
  • trunk/src/VBox/Runtime/r3/freebsd/fileaio-freebsd.cpp

    r25645 r25724  
    472472}
    473473
    474 RTDECL(int) RTFileAioCtxWait(RTFILEAIOCTX hAioCtx, size_t cMinReqs, unsigned cMillisTimeout,
     474RTDECL(int) RTFileAioCtxWait(RTFILEAIOCTX hAioCtx, size_t cMinReqs, RTMSINTERVAL cMillies,
    475475                             PRTFILEAIOREQ pahReqs, size_t cReqs, uint32_t *pcReqs)
    476476{
     
    498498    struct timespec     Timeout = {0,0};
    499499    uint64_t            StartNanoTS = 0;
    500     if (cMillisTimeout != RT_INDEFINITE_WAIT)
    501     {
    502         Timeout.tv_sec  = cMillisTimeout / 1000;
    503         Timeout.tv_nsec = cMillisTimeout % 1000 * 1000000;
     500    if (cMillies != RT_INDEFINITE_WAIT)
     501    {
     502        Timeout.tv_sec  = cMillies / 1000;
     503        Timeout.tv_nsec = cMillies % 1000 * 1000000;
    504504        pTimeout = &Timeout;
    505505        StartNanoTS = RTTimeNanoTS();
     
    573573        cReqs    -= cDone;
    574574
    575         if (cMillisTimeout != RT_INDEFINITE_WAIT)
     575        if (cMillies != RT_INDEFINITE_WAIT)
    576576        {
    577577            /* The API doesn't return ETIMEDOUT, so we have to fix that ourselves. */
    578578            uint64_t NanoTS = RTTimeNanoTS();
    579579            uint64_t cMilliesElapsed = (NanoTS - StartNanoTS) / 1000000;
    580             if (cMilliesElapsed >= cMillisTimeout)
     580            if (cMilliesElapsed >= cMillies)
    581581            {
    582582                rc = VERR_TIMEOUT;
     
    585585
    586586            /* The syscall supposedly updates it, but we're paranoid. :-) */
    587             Timeout.tv_sec  = (cMillisTimeout - (unsigned)cMilliesElapsed) / 1000;
    588             Timeout.tv_nsec = (cMillisTimeout - (unsigned)cMilliesElapsed) % 1000 * 1000000;
     587            Timeout.tv_sec  = (cMillies - (RTMSINTERVAL)cMilliesElapsed) / 1000;
     588            Timeout.tv_nsec = (cMillies - (RTMSINTERVAL)cMilliesElapsed) % 1000 * 1000000;
    589589        }
    590590    }
  • trunk/src/VBox/Runtime/r3/linux/fileaio-linux.cpp

    r25645 r25724  
    647647
    648648
    649 RTDECL(int) RTFileAioCtxWait(RTFILEAIOCTX hAioCtx, size_t cMinReqs, unsigned cMillisTimeout,
     649RTDECL(int) RTFileAioCtxWait(RTFILEAIOCTX hAioCtx, size_t cMinReqs, RTMSINTERVAL cMillies,
    650650                             PRTFILEAIOREQ pahReqs, size_t cReqs, uint32_t *pcReqs)
    651651{
     
    673673    struct timespec     Timeout = {0,0};
    674674    uint64_t            StartNanoTS = 0;
    675     if (cMillisTimeout != RT_INDEFINITE_WAIT)
     675    if (cMillies != RT_INDEFINITE_WAIT)
    676676    {
    677         Timeout.tv_sec  = cMillisTimeout / 1000;
    678         Timeout.tv_nsec = cMillisTimeout % 1000 * 1000000;
     677        Timeout.tv_sec  = cMillies / 1000;
     678        Timeout.tv_nsec = cMillies % 1000 * 1000000;
    679679        pTimeout = &Timeout;
    680680        StartNanoTS = RTTimeNanoTS();
     
    747747        cReqs    -= cDone;
    748748
    749         if (cMillisTimeout != RT_INDEFINITE_WAIT)
     749        if (cMillies != RT_INDEFINITE_WAIT)
    750750        {
    751751            /* The API doesn't return ETIMEDOUT, so we have to fix that ourselves. */
    752752            uint64_t NanoTS = RTTimeNanoTS();
    753753            uint64_t cMilliesElapsed = (NanoTS - StartNanoTS) / 1000000;
    754             if (cMilliesElapsed >= cMillisTimeout)
     754            if (cMilliesElapsed >= cMillies)
    755755            {
    756756                rc = VERR_TIMEOUT;
     
    759759
    760760            /* The syscall supposedly updates it, but we're paranoid. :-) */
    761             Timeout.tv_sec  = (cMillisTimeout - (unsigned)cMilliesElapsed) / 1000;
    762             Timeout.tv_nsec = (cMillisTimeout - (unsigned)cMilliesElapsed) % 1000 * 1000000;
     761            Timeout.tv_sec  = (cMillies - (RTMSINTERVAL)cMilliesElapsed) / 1000;
     762            Timeout.tv_nsec = (cMillies - (RTMSINTERVAL)cMilliesElapsed) % 1000 * 1000000;
    763763        }
    764764    }
  • trunk/src/VBox/Runtime/r3/linux/semevent-linux.cpp

    r25717 r25724  
    219219
    220220
    221 static int rtSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies, bool fAutoResume)
     221static int rtSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies, bool fAutoResume)
    222222{
    223223    PCRTLOCKVALSRCPOS pSrcPos = NULL;
     
    331331
    332332
    333 RTDECL(int)  RTSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies)
     333RTDECL(int)  RTSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    334334{
    335335    int rc = rtSemEventWait(hEventSem, cMillies, true);
     
    340340
    341341
    342 RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT hEventSem, unsigned cMillies)
     342RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    343343{
    344344    return rtSemEventWait(hEventSem, cMillies, false);
  • trunk/src/VBox/Runtime/r3/linux/semeventmulti-linux.cpp

    r25720 r25724  
    242242
    243243
    244 static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies, bool fAutoResume)
     244static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies, bool fAutoResume)
    245245{
    246246    PCRTLOCKVALSRCPOS pSrcPos = NULL;
     
    354354
    355355
    356 RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
     356RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    357357{
    358358    int rc = rtSemEventMultiWait(hEventMultiSem, cMillies, true);
     
    362362
    363363
    364 RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
     364RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    365365{
    366366    return rtSemEventMultiWait(hEventMultiSem, cMillies, false);
  • trunk/src/VBox/Runtime/r3/linux/semmutex-linux.cpp

    r25721 r25724  
    194194
    195195
    196 DECL_FORCE_INLINE(int) rtSemMutexRequest(RTSEMMUTEX hMutexSem, unsigned cMillies, bool fAutoResume, PCRTLOCKVALSRCPOS pSrcPos)
     196DECL_FORCE_INLINE(int) rtSemMutexRequest(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies, bool fAutoResume, PCRTLOCKVALSRCPOS pSrcPos)
    197197{
    198198    /*
     
    343343
    344344#undef RTSemMutexRequest
    345 RTDECL(int) RTSemMutexRequest(RTSEMMUTEX hMutexSem, unsigned cMillies)
     345RTDECL(int) RTSemMutexRequest(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies)
    346346{
    347347#ifndef RTSEMMUTEX_STRICT
     
    356356
    357357
    358 RTDECL(int) RTSemMutexRequestDebug(RTSEMMUTEX hMutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
     358RTDECL(int) RTSemMutexRequestDebug(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
    359359{
    360360    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
     
    366366
    367367#undef RTSemMutexRequestNoResume
    368 RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, unsigned cMillies)
     368RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies)
    369369{
    370370#ifndef RTSEMMUTEX_STRICT
     
    377377
    378378
    379 RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX hMutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
     379RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
    380380{
    381381    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
  • trunk/src/VBox/Runtime/r3/os2/sems-os2.cpp

    r25721 r25724  
    8989
    9090
    91 RTDECL(int)   RTSemEventWaitNoResume(RTSEMEVENT hEventSem, unsigned cMillies)
     91RTDECL(int)   RTSemEventWaitNoResume(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    9292{
    9393    /*
     
    226226
    227227
    228 RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
     228RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    229229{
    230230    /*
     
    327327
    328328#undef RTSemMutexRequestNoResume
    329 RTDECL(int)  RTSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, unsigned cMillies)
     329RTDECL(int)  RTSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies)
    330330{
    331331    /*
  • trunk/src/VBox/Runtime/r3/os2/thread-os2.cpp

    r16311 r25724  
    176176
    177177
    178 RTDECL(int)   RTThreadSleep(unsigned cMillies)
     178RTDECL(int)   RTThreadSleep(RTMSINTERVAL cMillies)
    179179{
    180180    LogFlow(("RTThreadSleep: cMillies=%d\n", cMillies));
  • trunk/src/VBox/Runtime/r3/posix/fileaio-posix.cpp

    r25645 r25724  
    807807
    808808
    809 RTDECL(int) RTFileAioCtxWait(RTFILEAIOCTX hAioCtx, size_t cMinReqs, unsigned cMillisTimeout,
     809RTDECL(int) RTFileAioCtxWait(RTFILEAIOCTX hAioCtx, size_t cMinReqs, RTMSINTERVAL cMillies,
    810810                             PRTFILEAIOREQ pahReqs, size_t cReqs, uint32_t *pcReqs)
    811811{
     
    832832        return VERR_INVALID_PARAMETER;
    833833
    834     if (cMillisTimeout != RT_INDEFINITE_WAIT)
     834    if (cMillies != RT_INDEFINITE_WAIT)
    835835    {
    836         Timeout.tv_sec  = cMillisTimeout / 1000;
    837         Timeout.tv_nsec = (cMillisTimeout % 1000) * 1000000;
     836        Timeout.tv_sec  = cMillies / 1000;
     837        Timeout.tv_nsec = (cMillies % 1000) * 1000000;
    838838        pTimeout = &Timeout;
    839839        StartNanoTS = RTTimeNanoTS();
     
    964964                break;
    965965
    966             if (cMillisTimeout != RT_INDEFINITE_WAIT)
     966            if (cMillies != RT_INDEFINITE_WAIT)
    967967            {
    968968                uint64_t TimeDiff;
     
    970970                /* Recalculate the timeout. */
    971971                TimeDiff = RTTimeSystemNanoTS() - StartNanoTS;
    972                 Timeout.tv_sec = Timeout.tv_sec - (TimeDiff / 1000000);
     972                Timeout.tv_sec  = Timeout.tv_sec - (TimeDiff / 1000000);
    973973                Timeout.tv_nsec = Timeout.tv_nsec - (TimeDiff % 1000000);
    974974            }
  • trunk/src/VBox/Runtime/r3/posix/semevent-posix.cpp

    r25717 r25724  
    288288
    289289
    290 DECL_FORCE_INLINE(int) rtSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies, bool fAutoResume)
     290DECL_FORCE_INLINE(int) rtSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies, bool fAutoResume)
    291291{
    292292    PCRTLOCKVALSRCPOS  pSrcPos = NULL;
     
    464464
    465465
    466 RTDECL(int)  RTSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies)
     466RTDECL(int)  RTSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    467467{
    468468    int rc = rtSemEventWait(hEventSem, cMillies, true);
     
    472472
    473473
    474 RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT hEventSem, unsigned cMillies)
     474RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    475475{
    476476    return rtSemEventWait(hEventSem, cMillies, false);
  • trunk/src/VBox/Runtime/r3/posix/semeventmulti-posix.cpp

    r25720 r25724  
    323323
    324324
    325 static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies, bool fAutoResume)
     325static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies, bool fAutoResume)
    326326{
    327327    PCRTLOCKVALSRCPOS pSrcPos = NULL;
     
    495495
    496496
    497 RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
     497RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    498498{
    499499    int rc = rtSemEventMultiWait(hEventMultiSem, cMillies, true);
     
    503503
    504504
    505 RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
     505RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    506506{
    507507    return rtSemEventMultiWait(hEventMultiSem, cMillies, false);
  • trunk/src/VBox/Runtime/r3/posix/semmutex-posix.cpp

    r25721 r25724  
    180180
    181181
    182 DECL_FORCE_INLINE(int) rtSemMutexRequest(RTSEMMUTEX hMutexSem, unsigned cMillies, PCRTLOCKVALSRCPOS pSrcPos)
     182DECL_FORCE_INLINE(int) rtSemMutexRequest(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies, PCRTLOCKVALSRCPOS pSrcPos)
    183183{
    184184    /*
     
    281281
    282282#undef RTSemMutexRequest
    283 RTDECL(int) RTSemMutexRequest(RTSEMMUTEX hMutexSem, unsigned cMillies)
     283RTDECL(int) RTSemMutexRequest(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies)
    284284{
    285285#ifndef RTSEMMUTEX_STRICT
     
    292292
    293293
    294 RTDECL(int) RTSemMutexRequestDebug(RTSEMMUTEX hMutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
     294RTDECL(int) RTSemMutexRequestDebug(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
    295295{
    296296    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
     
    300300
    301301#undef RTSemMutexRequestNoResume
    302 RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, unsigned cMillies)
     302RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies)
    303303{
    304304    /* (EINTR isn't returned by the wait functions we're using.) */
     
    312312
    313313
    314 RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX hMutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
     314RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
    315315{
    316316    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
  • trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp

    r25638 r25724  
    266266
    267267
    268 RTDECL(int) RTThreadSleep(unsigned cMillies)
     268RTDECL(int) RTThreadSleep(RTMSINTERVAL cMillies)
    269269{
    270270    LogFlow(("RTThreadSleep: cMillies=%d\n", cMillies));
  • trunk/src/VBox/Runtime/r3/solaris/fileaio-solaris.cpp

    r25645 r25724  
    433433}
    434434
    435 RTDECL(int) RTFileAioCtxWait(RTFILEAIOCTX hAioCtx, size_t cMinReqs, unsigned cMillisTimeout,
     435RTDECL(int) RTFileAioCtxWait(RTFILEAIOCTX hAioCtx, size_t cMinReqs, RTMSINTERVAL cMillies,
    436436                             PRTFILEAIOREQ pahReqs, size_t cReqs, uint32_t *pcReqs)
    437437{
     
    459459    struct timespec     Timeout = {0,0};
    460460    uint64_t            StartNanoTS = 0;
    461     if (cMillisTimeout != RT_INDEFINITE_WAIT)
    462     {
    463         Timeout.tv_sec  = cMillisTimeout / 1000;
    464         Timeout.tv_nsec = cMillisTimeout % 1000 * 1000000;
     461    if (cMillies != RT_INDEFINITE_WAIT)
     462    {
     463        Timeout.tv_sec  = cMillies / 1000;
     464        Timeout.tv_nsec = cMillies % 1000 * 1000000;
    465465        pTimeout = &Timeout;
    466466        StartNanoTS = RTTimeNanoTS();
     
    517517        cReqs    -= cRequests;
    518518
    519         if (cMillisTimeout != RT_INDEFINITE_WAIT)
     519        if (cMillies != RT_INDEFINITE_WAIT)
    520520        {
    521521            uint64_t NanoTS = RTTimeNanoTS();
     
    523523
    524524            /* The syscall supposedly updates it, but we're paranoid. :-) */
    525             Timeout.tv_sec  = (cMillisTimeout - (unsigned)cMilliesElapsed) / 1000;
    526             Timeout.tv_nsec = (cMillisTimeout - (unsigned)cMilliesElapsed) % 1000 * 1000000;
     525            if (cMilliesElapsed < cMillies)
     526            {
     527                Timeout.tv_sec  = (cMillies - (RTMSINTERVAL)cMilliesElapsed) / 1000;
     528                Timeout.tv_nsec = (cMillies - (RTMSINTERVAL)cMilliesElapsed) % 1000 * 1000000;
     529            }
     530            else
     531            {
     532                Timeout.tv_sec  = 0;
     533                Timeout.tv_nsec = 0;
     534            }
    527535        }
    528536    }
  • trunk/src/VBox/Runtime/r3/tcp.cpp

    r25000 r25724  
    882882
    883883
    884 RTR3DECL(int)  RTTcpSelectOne(RTSOCKET Sock, unsigned cMillies)
     884RTR3DECL(int)  RTTcpSelectOne(RTSOCKET Sock, RTMSINTERVAL cMillies)
    885885{
    886886    fd_set fdsetR;
  • trunk/src/VBox/Runtime/r3/win/fileaio-win.cpp

    r25645 r25724  
    386386}
    387387
    388 RTDECL(int) RTFileAioCtxWait(RTFILEAIOCTX hAioCtx, size_t cMinReqs, unsigned cMillisTimeout,
     388RTDECL(int) RTFileAioCtxWait(RTFILEAIOCTX hAioCtx, size_t cMinReqs, RTMSINTERVAL cMillies,
    389389                             PRTFILEAIOREQ pahReqs, size_t cReqs, uint32_t *pcReqs)
    390390{
     
    417417    int cRequestsCompleted = 0;
    418418    while (   !pCtxInt->fWokenUp
    419            && (cMinReqs > 0))
     419           && cMinReqs > 0)
    420420    {
    421421        uint64_t     StartNanoTS = 0;
    422         DWORD        dwTimeout = cMillisTimeout == RT_INDEFINITE_WAIT ? INFINITE : cMillisTimeout;
     422        DWORD        dwTimeout = cMillies == RT_INDEFINITE_WAIT ? INFINITE : cMillies;
    423423        DWORD        cbTransfered;
    424424        LPOVERLAPPED pOverlapped;
     
    426426        BOOL         fSucceeded;
    427427
    428         if (cMillisTimeout != RT_INDEFINITE_WAIT)
     428        if (cMillies != RT_INDEFINITE_WAIT)
    429429            StartNanoTS = RTTimeNanoTS();
    430430
     
    446446        if (lCompletionKey == AIO_CONTEXT_WAKEUP_EVENT)
    447447            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)
    449472        {
    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;
    479480        }
    480481    }
  • trunk/src/VBox/Runtime/r3/win/semevent-win.cpp

    r25717 r25724  
    197197
    198198#undef RTSemEventWaitNoResume
    199 RTDECL(int)   RTSemEventWaitNoResume(RTSEMEVENT hEventSem, unsigned cMillies)
     199RTDECL(int)   RTSemEventWaitNoResume(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    200200{
    201201    PCRTLOCKVALSRCPOS pSrcPos = NULL;
  • trunk/src/VBox/Runtime/r3/win/semeventmulti-win.cpp

    r25720 r25724  
    221221
    222222#undef RTSemEventMultiWaitNoResume
    223 RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
     223RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    224224{
    225225    PCRTLOCKVALSRCPOS pSrcPos = NULL;
  • trunk/src/VBox/Runtime/r3/win/semmutex-win.cpp

    r25721 r25724  
    174174 * @param   pSrcPos             The source position of the caller.
    175175 */
    176 DECL_FORCE_INLINE(int) rtSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, unsigned cMillies, PCRTLOCKVALSRCPOS pSrcPos)
     176DECL_FORCE_INLINE(int) rtSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies, PCRTLOCKVALSRCPOS pSrcPos)
    177177{
    178178    /*
     
    251251
    252252#undef RTSemMutexRequestNoResume
    253 RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, unsigned cMillies)
     253RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies)
    254254{
    255255#ifndef RTSEMMUTEX_STRICT
     
    262262
    263263
    264 RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX hMutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
     264RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX hMutexSem, RTMSINTERVAL cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
    265265{
    266266    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
  • trunk/src/VBox/Runtime/r3/win/thread-win.cpp

    r13837 r25724  
    146146
    147147
    148 RTR3DECL(int)   RTThreadSleep(unsigned cMillies)
     148RTR3DECL(int)   RTThreadSleep(RTMSINTERVAL cMillies)
    149149{
    150150    LogFlow(("RTThreadSleep: cMillies=%d\n", cMillies));
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette