VirtualBox

Changeset 405 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Jan 28, 2007 9:31:03 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
17976
Message:

We're better off using the generic timer implementation on darwin. I get 201 ticks max with the posix one, while the generic manages more than 430 and only fails on the 1ms interval test. (tried three tstTimer instances in parallel, no trouble)

Location:
trunk/src/VBox/Runtime
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/Makefile

    r403 r405  
    307307        r3/posix/thread-posix.cpp \
    308308        r3/darwin/time-darwin.cpp \
    309         r3/posix/timer-posix.cpp \
     309        generic/timer-generic.cpp \
    310310        generic/utf16locale-generic.cpp \
    311311        r3/posix/utf8-posix.cpp \
    312312        r3/linux/uuid-linux.cpp \
    313313        timesup.cpp \
     314
    314315
    315316
  • trunk/src/VBox/Runtime/generic/timer-generic.cpp

    r403 r405  
    8282RTDECL(int) RTTimerCreate(PRTTIMER *ppTimer, unsigned uMilliesInterval, PFNRTTIMER pfnTimer, void *pvUser)
    8383{
    84     return RTTimerCreateEx(ppTimer, uMilliesInterval * UINT64_C(1000000), 0, pfnTimer, pvUser);
     84    int rc = RTTimerCreateEx(ppTimer, uMilliesInterval * UINT64_C(1000000), 0, pfnTimer, pvUser);
     85    if (RT_SUCCESS(rc))
     86    {
     87        rc = RTTimerStart(*ppTimer, 0);
     88        if (RT_SUCCESS(rc))
     89            return rc;
     90        int rc2 = RTTimerDestroy(*ppTimer); AssertRC(rc2);
     91        *ppTimer = NULL;
     92    }
     93    return rc;
    8594}
    8695
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